1、首先在扩展程序里找到background插件进行安装:
2、打开设置,在搜索框中输入background,选择扩展中的plugin background,选择在setting.json中编辑
setting.json内容如下:
{
"window.zoomLevel": 1,
"workbench.colorTheme": "WeChat Dark",
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"background.loop": true,
"background.enabled": true,
"background.useDefault": false,
"background.customImages": [
"file:///D:BaiduNetdiskDownload/vscodeBackground/chu.gif"
],
"background.style": {
"content": "''",
"pointer-events": "none",
"position": "absolute",
"z-index": "99999",
"width": "100%",
"height": "100%",
"background-position": "center",
"background-repeat": "no-repeat",
"background-size": "100%,100%",
"opacity": 0.1
},
"editor.unicodeHighlight.nonBasicASCII": false,
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.codeActionsOnSave": null
}
这里需注意背景图片路径需要改成自己的本地图片存放路径:
“file:///D:BaiduNetdiskDownload/vscodeBackground/chu.gif”
3.在用户设置中输入以下代码,修改完后按Ctrl+S保存,会提示重启VS Code,点击确定后即可完成修改。
效果如下: