使用vscode如何设置vue模板

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_41805715/article/details/102767554

1.选择File中的Preferences中的User Snippets
2.搜索vue,选择vue.json
在这里插入图片描述
3.将下面内容复制到vue.json的大括号中,保存

"Print to console": {        
     "prefix": "vue",        
     "body": [          
         "<template>",          
         "   <div></div>",          
         "</template>",          
         "",
         "<script>",          
         "export default {",
         "   data () {",
         "      return {",
         "",
         "      };",
         "   },",
         "",
         "   components: {},",
         "",
         "   computed: {},",
         "",
         "   mounted: {},", 
         "",
         "  methods: {}",
         "}",
         "</script>",
         "<style lang='' scoped>",
         "",
         "</style>"
   ],
   "description": "Log output to console"
}

4.测试:新建一个vue文件,输入vue按Tab键生成vue模板(模板的内容可以根据自己的需要在上面的粘贴的代码中做调整)如下:
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_41805715/article/details/102767554
今日推荐