網(wǎng)站模板信息不存在網(wǎng)站推廣和優(yōu)化系統(tǒng)
問題:關(guān)于Better Comments默認(rèn)在html、TS、JS中有效,在vue中無效,需要單獨(dú)進(jìn)行配置
windows系統(tǒng)可以參考友鏈Better Comments(注釋高亮)在vue文件里失效的問題
關(guān)于Better Comments電腦的配置路徑:
Windows系統(tǒng):C:\Users\你的用戶名.vscode\extensions --> aaron-bond.better-comments-版本號(hào) --> out --> parser.js
macOS系統(tǒng):/Users/你的用戶名/.vscode/extensions --> aaron-bond.better-comments-版本號(hào) --> out --> parser.js
詳細(xì)修改文件路徑參考: .vscode --> .extensions --> aaron-bond.better-comments-版本號(hào) --> out --> parser.js
以mac os系統(tǒng)為🌰:首先打開電腦自帶終端(熟悉終端命令直接跳過按照詳細(xì)路徑一直進(jìn)入到parser.js進(jìn)行修改即可)
cd ~ //跳轉(zhuǎn)到根目錄
ls -a //查看根目錄下的 .vsCode
cd .vsCode // 效果如下圖所示,按照上面提供的詳細(xì)路徑一路cd到parser.js文件即可
繼續(xù)進(jìn)入選中的目錄,cd out //能夠看到parser.js 可以直接拖拽到vsCode打開或者通過命令vim修改 效果如下圖所示:
setDelimiter函數(shù)的switch中添加以下代碼: 效果如下圖所示:
case "vue":this.setCommentFormat("//", "/*", "*/")break;
最后一步:保存修改文件,關(guān)閉vsCode,重啟即可在.vue文件中使用Better Comments來寫注釋內(nèi)容**
拓展:關(guān)于自己的Better Comments配置文件參考:可以復(fù)制直接使用或自定義即可
"better-comments.tags": [{"tag": "!!","color": "#FF2D00","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "todo","color": "#FF2D00","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "TODO","color": "#FF2D00","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "?","color": "#3498DB","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "、、","color": "#474747","strikethrough": true,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "!","color": "#FF8C00","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "info","color": "#CCFFFF","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "tip","color": "#CCFFFF","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "important","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "example","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "future","color": "#CCFFFF","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "未完成","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "@","color": "#CCFFFF","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "test","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "warn","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "step","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "^","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "fail","color": "#FFFFCC","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false},{"tag": "***","color": "#98C379","strikethrough": false,"underline": false,"backgroundColor": "transparent","bold": false,"italic": false}],