1.用快捷Ctrl + Shift + P唤出控制台

输入“Snippets”并选择 Snippets: Configure User Snippets

2.输入vue,选中vue.json

vs code自动生成vue.json文件

3.在 vue.json 中添加模板

{
	"Print to console": {
			"prefix": "vue2",
			"body": [
					"<template>",
					"  <div></div>",
					"</template>",
					"",
					"<script>",
					"export default {",
					"  components: {},",
					"  props: {},",
					"  data() {",
					"    return {",
					"    };",
					"  },",
					"  watch: {},",
					"  computed: {},",
					"  methods: {},",
					"  created() {},",
					"  mounted() {}",
					"};",
					"</script>",
					"<style lang=\"less\" scoped>",
					"</style>"
			],
			"description": "A vue file template"
	}
}

4.新建一个 vue 文件,输入“vue2”,按下回车键,自动生成模板

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部