As is well known, VUE can be used to observe and respond to the data changes on the Vue instance, then the applet can be achieved?The principle of the listener is to write data that needs to be listened in the DATA in the Watch object, and provides a method to call the method when the value of the listened data is changed.
Object.defineProperty () method, will define a new attribute directly on an object, or modify the existing properties of an object, and return to this object.
Here, there are multiple pages that need to be listened to the needs, write the monitoring method in app.js so that global call
, then the page that needs to be listened ONLOAD, calling the Watch method (where Test is the data to be listened. When Test assigns the value in other methods, Watch can monitor Test changes)
The above is all the contents of this article, I hope to help everyone, I hope everyone can support Tumi Cloud.