fengyuanchen / vue-countdown

Countdown component for Vue.js.
https://fengyuanchen.github.io/vue-countdown/
MIT License
691 stars 89 forks source link

[fature-request] Add a restart method #79

Closed DannyFeliz closed 2 years ago

DannyFeliz commented 2 years ago

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

fengyuanchen commented 2 years ago

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

DannyFeliz commented 2 years ago

@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.

fengyuanchen commented 2 years ago

You can also remount the component.

DannyFeliz commented 2 years ago

@fengyuanchen that is not feasible for my use case.

I created a PR adding the restart method.

xiaozi commented 2 years ago

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.

fengyuanchen commented 2 years ago

Supports this as of v2.1.0.