1、安装插件:Vetur/vueHelper
2、文件—》首选项—》用户代码片段
添加如下代码:
"vue": {
"prefix": "vue",
"body": [
"<template>",
" <div>",
" ",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" components: {},",
" data() {",
" return {",
" ",
" }",
" }",
"}",
"</script>",
"",
"<style lang='less' scoped>",
"</style>",
],
"description": "generate a vue file"
}
效果:
<template>
<div>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
}
}
}
</script>
<style lang='less' scoped>
</style>
参考文档:https://blog.csdn.net/pengjunlee/article/details/97136104
网友评论