In 1. The role of watch in vue is just like its name, which is the role of monitoringFor example, there is an object: watchData: { name: '', age: '', } 2. Monitor the properties of this objectwatchData: { handler: function() { console.log(); }, deep: true } The monitoring object can be monitored with 3. Monitor the properties of this objectMethod 1: watch: 'watchData.name'(newValue, oldValue) { console.log(newValue); } } Method 2: watch: 'watchData.name': { handler: function() { console.log(); } } }, Why do we need to monitor the properties of an object? If we monitor an object, any data inside the object will cause 4. Monitor the properties of this objectcomputed: { getName() { return this.watchData.name } }, watch: getName(newValue, oldValue) { console.log(newValue); } }, This method is actually the same as the second one. The difference is that This is the end of this article about the summary of vue watch monitoring method. For more relevant vue watch monitoring method content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: DHCP Configuration Tutorial in CentOS7 Environment
>>: CSS implements 0.5px lines to solve mobile compatibility issues (recommended)
1. Environment VS 2019 16.9.0 Preview 1.0 .NET SD...
1. Apache server installation and configuration y...
Table of contents Preface Introduction ngram full...
This article mainly explains tables, which are no...
Since there is a button in my company's produ...
After the docker installation is completed on the...
1Basic steps of echarts Four Steps 1 Find the DOM...
1. Create a new rabbitmq in the /etc/init.d direc...
Spring integration with springmvc The web.xml con...
I have roughly listed some values to stimulate ...
Table of contents 1 Question 2 Methods 3 Experime...
This article example shares the specific code of ...
Table of contents 1. Comparison with Vue2 1. New ...
This article example shares the specific code of ...
Operating environment: MAC Docker version: Docker...