百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vite-plugin-vue-nested-sfc

> 前端框架
开源

在你的SFC里面有SFC.

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

在你的SFC里面有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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptpluginvitevite-pluginvue

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

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