在vscode中如何自定义用户代码段(代码模板)
①打开vscode,点击左下角设置按钮,会弹出设置窗口,点击用户代码片段 ②将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模板"
}
}
|