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"
	}
}

然後在新建的vue文件中輸入vue按下回車,即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章