背景:
每次建立一个vue文件都要手写一遍,直接写个模板好了
方法:
打开Vscode编辑器,依次选择“文件 -> 首选项 -> 用户代码片段”,此时,会弹出一个搜索框,我们输入vue, 如下:
选择vue后,Vscode会自动打开一个名字为vue.json的文件,复制以下内容到这个文件中:
{
{
"Print to console": {
"prefix": "vue",
"body": [
"<!-- $0 -->",
"<template>",
"<div></div>",
"</template>",
"",
"<script>",
"export default {",
"data () {",
" return {",
" };",
"},",
"",
"components: {},",
"",
"computed: {},",
"",
"mounted: {},",
"",
"methods: {}",
"}",
"",
"</script>",
"<style lang='less' scoped>",
"</style>"
],
"description": "Log output to console"
}
}
最后,看完本篇博客后,觉得挺有帮助的话,可以继续查看专栏其它内容嗷,一起来学习Vue吧~
点击进入Vue❤学习专栏~
学如逆水行舟,不进则退