vscode vue 定义 单文件模板

    "Print to console": {
		"prefix": "vue",
		"body": [
	"<template>",
  		"<div>",
			"\r",
  		"</div>",
	"</template>",

	"<script>",
	"export default {",
    	"\tname:\"\",",
    	"\tdata(){",
        	"\t\treturn {",
					"\r",
        	"\t\t}",
		"\t},",
			"\r",
    	"\t// props 可以是数组或对象,用于接收来自父组件的数据",
    	"\tprops:[],",
			"\r",
    	"\t// Vue 实例将会在实例化时调用 $watch(),遍历 watch 对象的每一个 property。",
    	"\twatch:{},",
			"\r",
    	"\t// 计算属性",
    	"\tcomputed:{},",
			"\r",
    	"\t// 方法;",
    	"\tmethods:{},",
			"\r",
    	"\t// 在实例初始化之后,数据观测 (data observer) 和 event/watcher 事件配置之前被调用。",
    	"\tbeforeCreate () {},",
			"\r",
    	"\t// 在实例创建完成后被立即调用。",
    	"\tcreated () {},",
			"\r",
    	"\t// 在挂载开始之前被调用:相关的 render 函数首次被调用。",
		"\tbeforeMount () {},",
			"\r",
    	"\t// 实例被挂载后调用",
    	"\tmounted() {},",
			"\r",
    	"\t// 被 keep-alive 缓存的组件激活时调用。",
    	"\tactivated () {},",
			"\r",
    	"\t//被 keep-alive 缓存的组件停用时调用。",
    	"\tdeactivated () {},",
			"\r",
    	"\t// 实例销毁之前调用。在这一步,实例仍然完全可用。",
    	"\tbeforeDestroy () {},",
			"\r",
    	"\t// 实例销毁后调用",
    	"\tdestroyed () {},",
			"\r",
    	"\t// 组件",
   		"\tcomponents:{},",
		   "\r",
   		"\t// 过滤器",
   		"\tfilters: {},",
		   "\r",
   		"\t// 自定义指令",
		"\tdirectives:{},",
		   "\r",
   		"\t//mixins 选项接收一个混入对象的数组",
   		"\tmixins:[],",

    	"\t// 进入这个路由时调用",
    	"\tbeforeRouteEnter(to,from,next){",
    	    "\t\twindow.document.body.style.backgroundColor=\"\"",
    	    "\t\twindow.document.title=\"title\"",
    	    "\t\tnext()",
		"\t},",

			"\r",

    	"\t// 离开这个路由时调用",
    	"\tbeforeRouteLeave(to,from,next){",
    	    "\t\twindow.document.body.style.backgroundColor=\"\"",
    	    "\t\twindow.document.title=\"title\"",
    	    "\t\tnext()",
    	"\t}",

	"}",

	"</script>",

	"<style lang=\"less\" scoped>",

	"</style>",

		],
		"description": "Vue 单文件模板"
	}  


posted @ 2020-08-18 18:57  kgwei  阅读(208)  评论(0编辑  收藏  举报