{
// 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 letiables 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:
"控制台输出": {
"prefix": "log",
"body": [
"console.log($1)",
],
"description": "控制台输出"
},
"阻止默认事件": {
"prefix": "ep",
"body": [
"e.preventDefault()",
],
"description": "阻止默认事件"
},
"遍历数组": {
"prefix": "for",
"body": [
"for(let i = 0; i<arr.length; i++) {",
"\tconsole.log(arr[i])",
"}",
],
"description": "遍历数组"
},
"遍历对象": {
"prefix": "forin",
"body": [
"for(let key in obj){",
"\tlet value = obj[key]",
"}",
],
"description": "遍历对象"
},
"axios": {
"prefix": "axios",
"body": [
"axios({",
"\turl:'请求路径',",
"\tmethod:'get',",
"\tdata: { 'post请求参数'},",
"\tparams: { 'get请求参数'}",
"}).then(res=>{",
"\t//成功回调",
"\tconsole.log(res)",
"})",
],
"description": "axios请求"
},
"背景颜色": {
"prefix": "backgroundColor",
"body": [
"backgroundColor",
],
"description": "背景颜色"
},
"compotents": {
"prefix": "components:{}",
"body": [
"components:{$1}",
],
"description": "compotents"
},
"slot": {
"prefix": "<slot name=''></slot>",
"body": [
"<slot name='$1'></slot>",
],
"description": "slot"
},
"v-slot": {
"prefix": "v-slot:",
"body": [
"v-slot:",
],
"description": "v-slot"
},
"全局自定义指令注册": {
"prefix": "directive",
"body": [
"Vue.directive('focus', {",
"\tinserted(el) {",
"\t\tel.focus()",
"\t}",
"})"
],
"description": "全局注册"
},
"局部自定义指令注册": {
"prefix": "directives",
"body": [
"directives: {",
"\tfocus: {",
"\t\tinserted(el) {",
"\t\t\tel.focus()",
"\t\t}",
"\t}",
"}"
],
"description": "局部注册"
},
"alert": {
"prefix": "alert",
"body": [
"alert('$1')",
],
"description": "alert()"
},
"prompt": {
"prefix": "prompt",
"body": [
"prompt('$1')",
],
"description": "prompt"
},
"mounted": {
"prefix": "mounted",
"body": [
"mounted\t(){\n\t\t\t\n}",
],
"description": "mounted"
},
"data": {
"prefix": "data",
"body": [
"data(){\n\treturn{\t\n\t\t$1\n\t}\t\t\n},",
],
"description": "data"
},
"methods": {
"prefix": "methods",
"body": [
"methods:{\n\t$1\n},",
],
"description": "methods"
},
"filters": {
"prefix": "filters",
"body": [
"filters(){\n\t$1\n},",
],
"description": "filters"
},
"parentNode.style.backgroundColor": {
"prefix": "parentNode.style.backgroundColor",
"body": [
"parentNode.style.backgroundColor='$1'",
],
"description": "parentNode.style.backgroundColor"
},
"parentNode.style": {
"prefix": "parentNode.style",
"body": [
"parentNode.style",
],
"description": "parentNode.style"
},
"constructor": {
"prefix": "constructor",
"body": [
"constructor",
],
"description": "constructor"
},
}