1.点击vscode左上方 文件------>首选项--------->用户片段----------->vue.json(顶部搜索框搜索vue)
2.添加以下代码
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>\n",
"<script>",
"export default {",
" data() {",
" return {\n",
" };",
" },",
" created() {\n",
" },",
" mounted() {\n",
" },",
" methods: {\n",
" }",
"};",
"</script>\n",
"<style scoped>\n",
"</style>\n",
],
"description": "Create vue template"
}
}
3.新建vue页面,输入vue回车即可