vscode 设置默认模板

1.左下方管理按钮

2.用户代码片段

3.搜索html.json

4.{

  "Print to vue": {//print to 后面的vue是模板的命名
  "prefix": "vue",//选择代码片段时将使用的前缀,即要打出的快捷键
  "body": [//模板代码
  "<div id=\"app\">",
  "\t<div>{{number}}</div>",
  "\t<input type=\"button\" value=\"+\" @click=add() >",
  "</div>",
  "<script>",
  "\tconst app=new Vue({",
  "\t\tel:'#app',",
  "\t\tdata:{",
  "\t\t\tmessage:'hello',",
  "\t\t},",
  "\t\tmethods:{",
  "\t\t}",
  "\t})",
  "</script>"
  ],
  "description": "init vue template"//对模板的描述
  }
}

posted @ 2022-03-22 21:31  zf78  阅读(365)  评论(0)    收藏  举报