您的位置:首页 > Web前端 > Vue.js

vscode快速生成vue模板

2020-07-12 20:28 274 查看

1、新建代码片段:文件 -> 首选项 -> 用户片段 -> 输入vue.json
2、粘贴自己的vue模板:

{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
"  <div class='$2'>$5</div>",
"</template>",
"",
"<script>",
"export default {",
"  data() {",
"    return {",
"",
"    };",
"  },",
"  computed: {},",
"  watch: {},",
"  methods: {",
"",
"  },",
"  created() {",
"",
"  },",
"  mounted() {",
"",
"  },",
"  beforeCreate() {},",
"  beforeMount() {},",
"  beforeUpdate() {},",
"  updated() {},",
"  beforeDestroy() {},",
"  destroyed() {},",
"  activated() {},",
"  components: {},",
"}",
"</script>",
"",
"<style lang='scss' scoped>",
"$4",
"</style>"
],
"description": "Log output to console"
}
}

上面代码中的 “prefix”: “vue”, 就是快捷键
最后保存好之后,新建.vue文件,输入vue,按tab键

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: