先来看看我在实际项目中的应用
在 components/index.ts 导出全部组件

在 assets/index.ts 导出全部图标

小程序中一键生成路由表,获取完美的类型提示

小程序中 assets/index.ts 导出全部图片地址

组件库中将分散的样式文件统一导出

以上,这真的是一个解放双手的好家伙
只要你会基本的 javascript 语法,就可以使用 @index
生成各式文件索引需求。
VSCode 插件市场:https://marketplace.visualstudio.com/items?itemName=JayFong.generate-index
GitHub:https://github.com/fjc0k/vscode-generate-index