vscode中快速生成vue模板

2023-07-29,,

首先:打开vs code 界面左下角如下图所示

选中打开齿轮选择用户代码片段

第一次搜索vue.json文件可能显示的是vue,或者没有,你可以先在vs code中下载Vetur插件先

打开vue.json后,默认是如下图

快速生成vue模板,需要在其中编辑加入下列代码:

"Vue": {
"prefix": "vue",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>",
"<script>",
"export default {",
" data() {",
" return {",
" }",
" },",
" created(){",
" },",
" computed:{",
" },",
" methods:{",
" },",
"}",
"</script>",
"<style>\n",
"</style>",
"$2"
]
}

  保存即可

vscode中快速生成vue模板的相关教程结束。

《vscode中快速生成vue模板.doc》

下载本文的Word格式文档,以方便收藏与打印。