Visual Studio Code 自定义快捷键,自动生成.vue文件

Visual Studio Code 自定义快捷键,自动生成.vue文件

1. File -> Perferences -> User Snippets -> 键入"vue" -> 打开第一个选项

###  vue.json
{
	"Print to console": {
		"prefix": "vue",
		"body": [
			"<!--",
			"/**",
			" * @name '${TM_FILENAME_BASE}'",
			" * @desc '$2'",
			" * @author ''",
			" * @time $CURRENT_YEAR年$CURRENT_MONTH月$CURRENT_DATE日 $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_DAY_NAME",
			" */",
			"-->",
			"<template>",
			"  <div></div>",
			"</template>",
			"",
			"<script>",
			"export default {",
			"  name: '${TM_FILENAME_BASE}',",
			"  components: {},",
			"  data () {",
			"    return {",
			"    }",
			"  },",
			"  props: {},",
			"  computed: {},",
			"  methods: {},",
			"  watch: {},",
			"  created () {},",
			"  mounted () {},",
			"  destroyed () {}",
			"}",
			"",
			"</script>",
			"<style lang='scss' scoped>",
			"</style>",
			""
		],
		"description": "Log output to console"
	}
}

posted @ 2020-09-27 07:00  小小小疯子  阅读(406)  评论(0编辑  收藏  举报