{
	// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }


	"Print to console": {
		"prefix": "log",
		"body": [
			"console.log('$1');",
			"$2"
		],
		"description": "Log output to console"
	},


	  "Print to js method": {
		"prefix": "zhushi",
		"body": [
		  "/**",
		  " * @Description: $0",
		  " * @MethodAuthor: Liszter",
		  " * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
		  "*/"
		],
	  },

}

主要是配置这个文件。


具体过程:

  1. ctrl+shift+p  打开

           

2. 输入 snippets

3.选择配置类型,各种语言都可以设置 

按照例子搞就行了。。。。 

基础版本的:

{
		"Print to console": {
		"prefix": "log",
		"body": [
			"console.log('$1');",
			"$2"
		],
		"description": "Log output to console"
	},
	  "Print to js method": {
		"prefix": "zhushi",
		"body": [
		  "/**",
		  " * @Description: $0",
		  " * @MethodAuthor: Liszter",
		  " * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
		  "*/"
		],
	  },
    

	  "Print to slot": {
		"prefix": "zujian",
		"body": [
		  "/**",
		  " * @Description: $0",
		  " * ",
		  " * 参数:(参数名 描述 类型 默认值)",
		  " * ",
		  " * 事件:",
		  " * ",
		  " * 插槽: ",
		  " * ",
		  " * ",
		  " * @MethodAuthor: Liszter",
		  " * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
		  "*/"
		],
	  },

	  "Print to zhushi": {
		"prefix": "author",
		"body": [
		  "/**",
		  " * ",
		  " * ",
		  " * ",
		  " * @MethodAuthor: Liszter",
		  " * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
		  "*/"
		],
	  },
}

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐