Home >Web Front-end >Vue.js >What are the common properties in vue.js
Commonly used attributes in vue.js are: 1. el attribute; 2. data attribute; 3. template attribute; 4. methods attribute; 5. render attribute; 6. computed attribute; 7. watch attribute.
The operating environment of this article: windows10 system, vue.js 2.9, thinkpad t480 computer.
Vue is a progressive framework for building user interfaces. Its core library only focuses on the view layer. It is not only easy to get started, but also easy to integrate with third-party libraries or existing projects. On the other hand, when combined with a modern tool chain and various supporting libraries, Vue is fully capable of providing drivers for complex single-page applications.
The following are some common properties in vue, let’s take a look.
el attribute
is used to instruct the vue compiler from where to start parsing vue's syntax. It can be said to be a placeholder.
data attribute
is used to organize the attributes abstracted from the view. It can be said that the data of the view is abstracted and stored in data.
template attribute
is used to set the template and will replace page elements, including placeholders.
methods attribute
Place the business logic in the page, js methods are generally placed in methods
render attribute
Create a real Virtual Dom
computed attribute
Used Calculation
Vue.js calculated properties, calculated properties are very useful when dealing with some complex logic
watch property
Vue.js listens to the property watch. We can respond to data changes through watch
watch:function(new,old){} monitors the data in data Change two parameters, one returns the new value and the other returns the old value.
Recommended learning: php training
The above is the detailed content of What are the common properties in vue.js. For more information, please follow other related articles on the PHP Chinese website!