以Mac系统为例
打开“Code” —— “首选项”——“配置用户代码片段”, 输入 vue,选择 vue.json ==> 在vue.json文件里填入 模板可直接copy使用
:
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div class=\"\">\n",
" </div>",
"</template>\n",
"<script>",
"export default {",
" name: '',",
" data() {",
" return {}",
" },",
" components: {",
" ",
" },",
" computed: {",
" ",
" },",
" mounted: {",
" ",
" },",
" methods: {",
" ",
" },",
"}",
"</script>\n",
"<style scoped>",
"",
"</style>",
"$2"
],
"description": "Log output to console"
}
}
以上就算配置完成了。接下来是测试:
新建一个test.vue
文件,输入“vue”,按下Enter键就能快速生成自己想要的模板了。