使用插件vetur
- 进行一些简单的模版配置
文件–>首选项–>用户片段–>新增片段–>取名vue.json
2.引入模版 可以自己按照自己的来改
{
"Print to console": {
"prefix": "vue",
"body": [
"<!-- 组件说明 -->",
"<template>",
"\t<div class=''>\n\t\t$2\n\t</div>",
"</template>",
"",
"<script>",
"\t//import x from ''",
"\texport default {",
"\t\tcomponents: {",
"",
"\t\t},",
"\t\tdata () {",
"\t\t\treturn {",
"",
"\t\t\t};",
"\t\t},",
"\t\tcomputed: {",
"",
"\t\t},",
"\t\tmethods: {",
"",
"\t\t},",
"mounted() {",
"",
"},",
"beforeCreate() {}, //生命周期 - 创建之前",
"beforeMount() {}, //生命周期 - 挂载之前",
"beforeUpdate() {}, //生命周期 - 更新之前",
"updated() {}, //生命周期 - 更新之后",
"beforeDestroy() {}, //生命周期 - 销毁之前",
"destroyed() {}, //生命周期 - 销毁完成",
"activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发",
"\t}",
"</script>",
"",
"<style lang='scss' scoped>",
"//@import url($3)",
"",
"</style>"
],
"description": "tplv output to vue-template"
}
}
3.输入vue 按键盘的tab就行 “prefix”: “vue”, 自己可以设置快捷键