What are the ways to write Vue components?

亚连
Release: 2018-06-23 15:43:00
Original
943 people have browsed it

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

   

<-- 注意:使用
Copy after login

The second typeuses the template tag

     
  

Copy after login

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

 
Copy after login

app.vue

    
Copy after login

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!

Related labels:
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