1. 安装一个插件,识别vue文件
插件库中搜索Vetur,下图中的第一个,点击安装,安装完成之后点击重新加载
![00609ef1ccec1b1292b5d44a4029be51.png](https://i-blog.csdnimg.cn/blog_migrate/a69416402279c84e4b081ea1e1c1b3cb.png)
2.新建代码片段
文件-->首选项-->用户代码片段-->点击新建代码片段--取名vue.json 确定
3.粘贴入自己写的.vue模板
"Print to console": {
"prefix": "vue",
"body": [
"<!-- $1 -->",
"<template>",
"<div class='$2'>$5</div>",
"</template>",
"",
"<script>",
"",
"export default {",
"components: {},",
"data() {",
"return {",
"",
"}",
"},",
"computed: {},",
"watch: {},",
"methods: {",
"",
"},",
"created() {",
"",
"},",
"mounted() {",
"",
"},",
"}",
"</script>",
"<style scoped>",
"$4",
"</style>"
],
"description": "Log output to console"
}
}
4.上面代码中的 "prefix": "vue", 就是快捷键;保存好之后,新建.vue结尾的文件
输入vue 按键盘的tab
![65e31b394eb1c30613577baaeac32b6a.png](https://i-blog.csdnimg.cn/blog_migrate/e88f3cea48aecef0160e997efec863c7.png)
![5538f70068698d88f266feddae704eeb.png](https://i-blog.csdnimg.cn/blog_migrate/c25657854b9770fc6d5008282256c200.png)