在vscode中如何自定义用户代码段(代码模板)
①打开vscode,点击左下角设置按钮,会弹出设置窗口,点击用户代码片段 ![在这里插入图片描述](https://img-blog.csdnimg.cn/8db3b9ae5e294fa1aec57d3503c1e59f.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NDA5MTYz,size_16,color_FFFFFF,t_70) ![在这里插入图片描述](https://img-blog.csdnimg.cn/159d039c3acb4a46a4c95e04450b869e.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0NDA5MTYz,size_16,color_FFFFFF,t_70) ②将html.json中的内容替换为下述内容
{
"Html5-Vue": {
"prefix": "vue",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">\n",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title>Title</title>",
"\t<script src=\"../vuejs/vue.js\"></script>",
"</head>\n",
"<body>",
"\t<div id=\"app\">$1\n\n\t</div>\n",
"\t<script>",
"\t\tconst app = new Vue({",
"\t\t\tel: '#app',",
"\t\t\tdata: {\n\n\t\t\t},",
"\t\t\tmethods: {\n\n\t\t\t}",
"\t\t});",
"\t</script>",
"</body>\n",
"</html>"
],
"description": "快速创建在html5编写的vue模板"
}
}
|