Home> Web Front-end> Vue.js> body text

VUE3 Basic Tutorial: Using Vue.js Single File Component (SFC)

WBOY
Release: 2023-06-16 08:57:46
Original
2612 people have browsed it

With the continuous development of front-end technology, Vue.js, as an efficient, convenient, and powerful front-end framework, has been increasingly used in development. With the official release of Vue.js3, one of the important updates is support for single file components (SFC). This article will introduce how to use single-file components in Vue.js3.

1. What is a single file component?

In Vue.js, a single-file component refers to encapsulating all related code of a Vue component (including HTML, CSS, and JavaScript) in a separate file. For example, a component named "HelloWorld" can be written as a single-file component in the following format:

  
Copy after login

In the above code, the