vue-countdown icon indicating copy to clipboard operation
vue-countdown copied to clipboard

[fature-request] Add a restart method

Open DannyFeliz opened this issue 2 years ago • 5 comments

It would be cool to have a restart method that takes the countdown to the initial time.

DannyFeliz avatar May 14 '22 14:05 DannyFeliz

You can call the end method first, and then call the start method to restart.

fengyuanchen avatar May 15 '22 03:05 fengyuanchen

@fengyuanchen the problem is that I have some actions in the end event and I don't want to be executed at least if finished for real.

DannyFeliz avatar May 16 '22 14:05 DannyFeliz

You can also remount the component.

fengyuanchen avatar May 22 '22 07:05 fengyuanchen

@fengyuanchen that is not feasible for my use case.

I created a PR adding the restart method.

DannyFeliz avatar May 22 '22 19:05 DannyFeliz

You can call the end method first, and then call the start method to restart.

end method make totalMilliseconds to be zero, then countdown cannot start again using start method.

xiaozi avatar Aug 13 '22 02:08 xiaozi

Supports this as of v2.1.0.

fengyuanchen avatar Aug 13 '22 08:08 fengyuanchen