Single-file components (SFC)

A Vue single-file component (SFC) is a .vue file that groups, in one file, a component's template (<template>), logic (<script setup>) and styles (<style>, optionally scoped). It is the basic unit of a modern Vue application.

Example

<script setup>
const titre = 'Hello'
</script>
<template><h1>{{ titre }}</h1></template>

Related concepts

The whole glossary