1👍
app
is application object and not root component instance, it plays the same role as Vue
in Vue 2.
It should be:
const instance = app.mount('#app')
...
instance.timer = ...
Unless Vue application is third-party code that cannot be modified, it’s a good practice to move all relevant logic (setInterval
, etc) inside the application and expose public methods to interact with the page.
- [Vuejs]-Jquery method stops to works after hide and show with vuejs
- [Vuejs]-"Failed to mount component: template or render function not defined" in Vue, despite using full compiler bundle
Source:stackexchange.com