Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vite-plugin-vue-nested-sfc

> 前端框架
Open source

Nest SFCs within your SFC.

100 stars0 likes2 views
WebsiteGitHub

About

Nest SFCs within your SFC.

vite-plugin-vue-nested-sfc

npm version npm downloads build License

Nest SFCs within your SFC.

Install

Install package:

bash
# npm
npm install -D vite-plugin-vue-nested-sfc

# yarn
yarn add -D vite-plugin-vue-nested-sfc

# pnpm
pnpm add -D vite-plugin-vue-nested-sfc

Add to vite config:

javascript
// vite.config.js
import vue from "@vitejs/plugin-vue";
import vueNestedSFC from "vite-plugin-vue-nested-sfc";

export default {
  plugins: [vue(), vueNestedSFC()],
};

Add volar plugin for IDE support:

jsonc
// tsconfig.app.json
{
  "vueCompilerOptions": {
    "plugins": ["vite-plugin-vue-nested-sfc/tooling"]
  }
}

Usage

Defining components

Nested components are defined with the `` block. The block's content is treated as if it's a seperate SFC.

xml

  
    Hello World!
  

  
    

      
    

  

Exporting

You can export nested components with the export attribute.

xml

  
    
  

  
    
      
    
  
  

Import them from other files as named exports.

xml

  
    Click me
  

License

Made with

Published under MIT License.

Issues· 2 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptpluginvitevite-pluginvue

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架