在我们开发项目的时候经常会创建各种各样的文件夹,自己创建的文件夹自己是能记得住的,但是别人创建的自己是不知道什么意思的,只能根据对文件夹名翻译,来猜测这个文件夹是用来做什么的,那么有没有一种工具那能够对编辑器中的文件夹添加一定的备注呢?
vscode插件
folder-alias是一个能为你的文件夹取别名的软件,添加名称之后不会影响代码,会在根目录创建一个folder-alias.json文件
folder-alias.json文件如下:
{
"public": {
"description": "公共文件"
},
"src/assets": {
"description": "静态资源"
},
"src/components": {
"description": "组件"
},
"src/router": {
"description": "路由"
},
"src/store": {
"description": "vuex"
},
"src/views": {
"description": "页面"
}
}
这样在编辑器中就可以一步了然的知道该文件夹的作用是什么了
webStorm插件
在webStrom的插件是TreeInfotip ,并且比vscode中的更加强大,可以添加背景色、设置图标等,会在根目录下面创建DirectoryV3.xml文件
DirectoryV3.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<trees>
<tree path="/node_modules" title="依赖"/>
<tree path="/public" title="公共文件"/>
<tree path="/src/assets" title="静态文件"/>
<tree path="/src/components" title="组件"/>
</trees>