Vue methods and properties1. MethodsUsage 1
Usage 2
Notice { {}}Call to write() Example
Event triggering @click=aa" can have () or not. If you need to pass parameters, add () 2. Computed propertiesWhat are computed properties?
Characteristics of computed properties
Methods in computed properties
Example computed:{ //Calculated properties//Calculated properties are cached//Directly call {{}} without writing () //When the attribute that the calculated attribute depends on changes, it will recalculate once bb(){ return this.arr.filter(a=>a.indexOf(this.search) > -1) }, cc:{ //When the calculated property is called, the get method is automatically triggered, and when the calculated property is modified, the set method is automatically triggered set(a){ console.log('I am set'+"received content"+a+"received content") }, get(){ console.log('I am get') return this.arr.filter(a=>a.indexOf(this.search) > -1) } } }, This is the end of this article about Vue's methods and property cases. For more information about Vue's methods and properties, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: CentOS 6 uses Docker to deploy redis master-slave database operation example
>>: How to add fields and comments to a table in sql
Be careful when listening for events that are tri...
What Beautiful HTML Code Looks Like How to write ...
Using SSH terminal (such as putty, xshell) to con...
This article shares the specific code of js to ac...
The specific steps of installing mysql5.7.18 unde...
The concept of lock ①. Lock, in real life, is a t...
systemd: The service systemctl script of CentOS 7...
Centos7 startup process: 1.post(Power-On-Self-Tes...
Copy code The code is as follows: <html xmlns=...
Table of contents 1. Basic Concepts 1.1 Two kinds...
Moreover, an article website built with a blog pro...
Before I start, let me emphasize that process.env...
There are many reasons why an application is as s...
Table of contents 1. Project environment: 2: DNS ...
1. Create a new virtual machine in VMware 15.5 1....