鍍金池/ 問答/HTML/ vscode 設(shè)置Resource Root

vscode 設(shè)置Resource Root

以前使用的webstorm設(shè)置src為資源根目錄
clipboard.png

所以路徑都是這么寫的


const App             = r => require.ensure([], () => r(require('/src/App.vue')), 'App');
const Home            = r => require.ensure([], () => r(require('/src/components/common/home/Home.vue')), 'Home');

是可以點擊路徑跳轉(zhuǎn)到文件。

但是使用vscode以后因為沒有設(shè)置資源根目錄,無法進行資源跳轉(zhuǎn)

回答
編輯回答
毀與悔

安裝Path Autocomplete插件,然后在用戶設(shè)置中設(shè)置如下:

"path-autocomplete.pathMappings": {
    "/test": "${folder}/src/Actions/test", // alias for /test
    "/": "${folder}/src", // the absolute root folder is now /src,
    "$root": ${folder}/src // the relative root folder is now /src
}

https://marketplace.visualstu...

2017年12月8日 19:49