增加vue模板快捷键,以及方法注释快捷键的总结

一、Vscode配置

1、进入首选项=>用户配置代码片段=>javascript
{
	"Print to zhushi": {
	"prefix": "zhushi",
	"body": [
		"<!--",
		"* @Description: $0",
		"* @Author: your name",
		"* @Date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
		"* @LastEditTime: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
		"* @LastEditors: Please set LastEditors",
		"-->"
	],
	"description": "a zhushi mode"
	},
	"Print to func": {
	"prefix": "func",
	"body": [
		"/**",
		" * @func $1",
		" * @Description $2",
		" * @Author: your name",
		" * @param {$3} $4 $5",
		" * @return {$6} $7",
		" */"
	],
	"description": "a func mode" 
	}
}
2、=>vue
{
	"Print to console": {
	    "prefix": "vue",
	    "body": [
			"<template>",
			" <div></div>",
			"</template>",
			"",
			"<script>",
			"export default {",
			" components: {},",
			" props: {},",
			" data() {",
			"  return {",
			"  };",
			" },",
			" watch: {},",
			" computed: {},",
			" methods: {},",
			" created() {},",
			" mounted() {}",
			"};",
			"</script>",
			"<style lang=\"scss\" scoped>",
			"</style>"
		],
	    "description": "A vue file template"
	}
	
}
在页面输入prefix相应的字段回车即可得当body中配置的内容,自己可以随意配置body中的内容。

此文借鉴的是小白白纳的文章

posted @ 2022-11-02 17:46  color_小浣熊  阅读(313)  评论(0编辑  收藏  举报
百度