使用vscode快速新建vue模版
1.新建代码片段
设置=>用户代码片段=>输入vue.json
2.设置vue.json 保存
"Create vue template": {
"prefix": "vue",
"body": [
"<template>",
"<div class='$2'>$5</div>",
"</template>",
"<script>",
"export default {",
"components: {},",
" data () {",
" return {",
" };",
" },",
"//监听属性 类似于data概念",
"computed: {},",
"//监控data中的数据变化",
"watch: {},",
"//方法集合",
"methods: {",
"",
"},",
"}",
"</script>",
"<style lang='less' scoped>",
"</style>"
],
"description": "Create vue template"
}
}