Visual Studio Code自动生成vue模板

在使用vs开发vue中经常新建vue文件进行模块开发,新建文件结构着实痛苦在这里插入图片描述
于是百度配置一下自己的vs编辑器:
1.点击vs左下角设置选择用户代码片段
2.输入vue回车,将下边代码复制粘贴到vue.json进行保存

{
	"Print to console": {
		"prefix": "vue",
		"body": [
			"<template>",
			"  <div>",
			"    $0",
			"  </div>",
			"</template>",
			"",
			"<script>",
			"",
			"  export default {",
			"    name:'',",
			"    props:[''],",
			"    data () {",
			"      return {",
			"",
			"      };",
			"    },",
			"",
			"    components: {},",
			"",
			"    computed: {},",
			"",
			"    beforeMount() {},",
			"",
			"    mounted() {},",
			"",
			"    methods: {},",
			"",
			"    watch: {}",
			"",
			"  }",
			"",
			"</script>",
			"<style lang='' scoped>",
			"",
			"</style>"
		],
		"description": "Log output to console"
	}
}

猜你喜欢

转载自blog.csdn.net/wangxinxin1992816/article/details/100982005