跳到主要内容

Single-File Components

Why SFC

  • Author modularized components using familiar HTML, CSS and JavaScript syntax
  • Component-scoped CSS

How It Works

Vue SFC is a framework-specific file format and must be pre-compiled by @vue/compiler-sfc into standard JavaScript and CSS. A compiled SFC is a standard JavaScript (ES) module - which means with proper build setup you can import an SFC like a module