DEV Community

Discussion on: Timer Component for Vue.js

Collapse
 
stefanovualto profile image
stefanovualto

Hi Rachel,
Have envisaged to use a computed property to format the currentTime in the template?

As a detail, personally I would use a setInterval instead of multiple setTimeout.

Collapse
 
rachel_cheuk profile image
Rachel

Thanks for the suggestion Stefan! It never occurred to me; it's certainly a more vue approach!

I've added a second codepen with the code refactored into computed methods. I think it's much easier to read now. Thank you for the suggestion!