2020 Vscode建立.vue模板 (不包含空格)

背景:

每次建立一个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❤学习专栏~

学如逆水行舟,不进则退
发布了367 篇原创文章 · 获赞 542 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/weixin_42429718/article/details/104010523