This article mainly introduces the three writing forms of vue components in detail, which has certain reference value. Interested friends can refer to it
The example of this article shares the vue component with everyone. The writing form is for your reference. The specific content is as follows
The first typeuses the script tag
<-- 注意:使用
The second typeuses the template tag
The third typeSingle file component
This method is commonly used in vue single-page applications. For details, see the official website: https://cn.vuejs.org/v2/guide/single-file-components.html
Create a file with the .vue suffix, component Hello.vue, and place it in the components folder
{{ msg }}
app.vue
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to achieve the select-all-cancel effect in JavaScript
##How to achieve the left menu effect using JavaScript
How to implement token verification using vue
How to implement a custom event mechanism using Javascript
The above is the detailed content of What are the ways to write Vue components?. For more information, please follow other related articles on the PHP Chinese website!