Home > Web Front-end > JS Tutorial > body text

Listening method watch

php中世界最好的语言
Release: 2018-06-13 09:46:45
Original
2239 people have browsed it

This time I will bring you the monitoring method watch. What are the precautions for using the monitoring method watch? The following is a practical case, let's take a look.

The watch itself is easy to understand. The watch is responsible for associating the data in the view with a certain function

When the data in the Vue view changes, the associated function will be executed




  
  监听方法watch的使用
  

  

  
Copy after login

corresponds to an object, the key is the observation expression, and the value is the corresponding callback. The value can also be a method name, or an object containing options. Call $watch() for each key during instantiation;

//使用官方vue-cli脚手架书写

Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

vue2 implements shopping cart address selection

jQuery can give priority to local preview when uploading images

The above is the detailed content of Listening method watch. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
vue
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!