先来看看我在实际项目中的应用
在 components/index.ts 导出全部组件
![image](https://tva3.sinaimg.cn/large/007gihbvly1gpj8tyif4cj30ta09i3zo.jpg)
在 assets/index.ts 导出全部图标
![image](https://tva2.sinaimg.cn/large/007gihbvly1gpj8zabsz6j31my07adhk.jpg)
小程序中一键生成路由表,获取完美的类型提示
![image](https://tvax3.sinaimg.cn/large/007gihbvly1gpj94sn37cj31qo0imwi0.jpg)
小程序中 assets/index.ts 导出全部图片地址
![image](https://tvax1.sinaimg.cn/large/007gihbvly1gpj98gj10nj31ss0ek0wx.jpg)
组件库中将分散的样式文件统一导出
![image](https://tvax1.sinaimg.cn/large/007gihbvly1gpj9dgaf9pj31j00cc77i.jpg)
以上,这真的是一个解放双手的好家伙
只要你会基本的 javascript 语法,就可以使用 @index
生成各式文件索引需求。
VSCode 插件市场:https://marketplace.visualstudio.com/items?itemName=JayFong.generate-index
GitHub:https://github.com/fjc0k/vscode-generate-index