Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any way to restart counter? #39

Closed
defji opened this issue Oct 2, 2019 · 5 comments
Closed

any way to restart counter? #39

defji opened this issue Oct 2, 2019 · 5 comments

Comments

@defji
Copy link

defji commented Oct 2, 2019

No method for restarting counter.

@fengyuanchen
Copy link
Owner

Just set time prop to its initial value again.

@fengyuanchen
Copy link
Owner

Or use v-if to rerender the component.

@defji
Copy link
Author

defji commented Oct 2, 2019

thanks dude! 🤘

@simonschaufi
Copy link

@fengyuanchen @defji I linked a new issue with this as I have the problem that setting the prop works only once. The second time the counter just continues to count down. Can anyone reproduce this?

@craigh411
Copy link

For anybody else looking at this, the simplest way to reset the timer is to set the time prop value to 0 and then reset it back using $nextTick:

this.time = 0
this.$nextTick(() => {
   this.time = 30000
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants