├── .gitignore
├── images
└── uni-app.jpg
├── .vscodeignore
├── .gitattributes
├── push.lua
├── .vscode
└── launch.json
├── snippets
├── condition_comment 2.json
├── vue.json
├── undisplay.json
├── condition_comment.json
├── javascriptreact.json
├── vue-template.json
├── vue-script 2.json
├── css.json
├── vue-script.json
├── uni_vue_js.json
├── ux.json
├── nml.json
├── javascript 2.json
├── uni_vue_tag.json
├── html.json
├── mui.json
└── vue-html.json
├── css.md
├── package.json
├── html.md
└── javascript.md
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.vsix
3 |
--------------------------------------------------------------------------------
/images/uni-app.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Wscats/uni-app/main/images/uni-app.jpg
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | .gitignore
4 | vsc-extension-quickstart.md
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behavior to automatically normalize line endings.
2 | * text=auto
3 |
4 |
--------------------------------------------------------------------------------
/push.lua:
--------------------------------------------------------------------------------
1 | print(os.execute('git add .'))
2 | print(os.execute('git commit -m "更新文档"'))
3 | print(os.execute('git push origin master'))
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that launches the extension inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "args": [
13 | "--extensionDevelopmentPath=${workspaceFolder}"
14 | ]
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/snippets/condition_comment 2.json:
--------------------------------------------------------------------------------
1 | {
2 | "#ifdef": {
3 | "body": [
4 | "",
5 | "$0",
6 | ""
7 | ],
8 | "prefix": "ifdef"
9 | },
10 | "#ifndef": {
11 | "body": [
12 | "",
13 | "$0",
14 | ""
15 | ],
16 | "prefix": "ifndef"
17 | }
18 | }
--------------------------------------------------------------------------------
/snippets/vue.json:
--------------------------------------------------------------------------------
1 | {
2 | "Vue Base": {
3 | "prefix": "vbase",
4 | "body": [
5 | "",
6 | "\t<${1:div}>",
7 | "",
8 | "\t${1:div}>",
9 | "",
10 | "",
11 | "",
16 | "",
17 | ""
20 | ],
21 | "description": "Base for Vue File"
22 | },
23 | "view_class": {
24 | "prefix": "viewclass",
25 | "triggerAssist": true,
26 | "body": [
27 | "",
28 | "\t$0",
29 | ""
30 | ]
31 | },
32 | "view for": {
33 | "prefix": "viewfor",
34 | "body": [
35 | "",
36 | "\t$0",
37 | ""
38 | ],
39 | "project": "uni-app",
40 | "scope": "source.vue.html",
41 | "description": "view带for循环"
42 | }
43 | }
--------------------------------------------------------------------------------
/snippets/undisplay.json:
--------------------------------------------------------------------------------
1 | {
2 | "{...}": {
3 | "prefix": "{",
4 | "body": [
5 | "{",
6 | "\t$0",
7 | "}"
8 | ],
9 | "scope": "_json_object.js",
10 | "hidden": true
11 | },
12 | "function(){...}": {
13 | "prefix": "(){}",
14 | "body": [
15 | "function($1){",
16 | "\t$0",
17 | "}"
18 | ],
19 | "scope": "_func_callback.js",
20 | "hidden": true
21 | },
22 | ":function(){...}": {
23 | "prefix": ":func",
24 | "body": [
25 | ":function($1){",
26 | "\t$0",
27 | "}"
28 | ],
29 | "scope": "_object_func_callback.js",
30 | "hidden": true
31 | },
32 | ":() => {...}": {
33 | "prefix": ":()",
34 | "body": [
35 | ": ($1) => {",
36 | "\t$0",
37 | "}"
38 | ],
39 | "scope": "_object_func_callback_arrow.js",
40 | "hidden": true
41 | },
42 | "(){...}": {
43 | "prefix": "(){}",
44 | "body": [
45 | "() {",
46 | "\t$0",
47 | "}"
48 | ],
49 | "scope": "_object_func_callback_method.js",
50 | "hidden": true
51 | },
52 | ":value": {
53 | "prefix": ":value",
54 | "body": [
55 | ":$0"
56 | ],
57 | "scope": "_object_property_callback.js",
58 | "hidden": true
59 | },
60 | ":stringvalue": {
61 | "prefix": ":value",
62 | "body": [
63 | ":\"$1\"$0"
64 | ],
65 | "scope": "_json_object_string.js",
66 | "hidden": true
67 | },
68 | ":stringvalue,": {
69 | "prefix": ":value",
70 | "body": [
71 | ":\"$1\",$0"
72 | ],
73 | "scope": "_json_object_string_with_comma.js",
74 | "hidden": true
75 | }
76 | }
--------------------------------------------------------------------------------
/snippets/condition_comment.json:
--------------------------------------------------------------------------------
1 | {
2 | "#ifdef": {
3 | "body": [
4 | "// #ifdef ${1:APP-PLUS/APP-VUE/APP-NVUE/MP/MP-ALIPAY/MP-BAIDU/MP-WEIXIN/MP-QQ/MP-TOUTIAO/MP-360/H5/QUICKAPP-WEBVIEW-HUAWEI/QUICKAPP-WEBVIEW-UNION/QUICKAPP-WEBVIEW}",
5 | "$0",
6 | "// #endif"
7 | ],
8 | "prefix": "ifdef"
9 | },
10 | "#ifndef": {
11 | "body": [
12 | "// #ifndef ${1:APP-PLUS/APP-VUE/APP-NVUE/MP/MP-ALIPAY/MP-BAIDU/MP-WEIXIN/MP-QQ/MP-TOUTIAO/MP-360/H5/QUICKAPP-WEBVIEW-HUAWEI/QUICKAPP-WEBVIEW-UNION/QUICKAPP-WEBVIEW}",
13 | "$0",
14 | "// #endif"
15 | ],
16 | "prefix": "ifndef"
17 | },
18 | "#ifdef ": {
19 | "body": [
20 | "// #ifdef ${1:APP-PLUS/APP-VUE/APP-NVUE/MP/MP-ALIPAY/MP-BAIDU/MP-WEIXIN/MP-QQ/MP-TOUTIAO/MP-360/H5/QUICKAPP-WEBVIEW-HUAWEI/QUICKAPP-WEBVIEW-UNION/QUICKAPP-WEBVIEW}",
21 | "$0",
22 | "// #endif"
23 | ],
24 | "prefix": "ifdef",
25 | "scope": "object.property.js",
26 | "hidden": true
27 | },
28 | "#ifndef ": {
29 | "body": [
30 | "// #ifndef ${1:APP-PLUS/APP-VUE/APP-NVUE/MP/MP-ALIPAY/MP-BAIDU/MP-WEIXIN/MP-QQ/MP-TOUTIAO/MP-360/H5/QUICKAPP-WEBVIEW-HUAWEI/QUICKAPP-WEBVIEW-UNION/QUICKAPP-WEBVIEW}",
31 | "$0",
32 | "// #endif"
33 | ],
34 | "prefix": "ifndef",
35 | "scope": "object.property.js",
36 | "hidden": true
37 | }
38 | }
--------------------------------------------------------------------------------
/css.md:
--------------------------------------------------------------------------------
1 | |API|Prefix|Description|
2 | |-|-|-|
3 | |`APP-PLUS`|platform-app,platform-app-plus,app,app-plus|APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
4 | |`APP-NVUE`|platform-app-nvue,platform-app-plus-nvue,app-nvue,app-plus-nvue|APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
5 | |`H5`|platform-h5,h5|H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
6 | |`MP-WEIXIN`|platform-mp-weixin,platform-weixin,platform-mp-wechat,platform-wechat,mp-weixin,weixin,mp-wechat,wechat|微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
7 | |`MP-ALIPAY`|platform-mp-alipay,platform-alipay,platform-mp-ali,platform-ali,mp-alipay,alipay,mp-ali,ali|支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
8 | |`MP-BAIDU`|platform-mp-baidu,platform-baidu,mp-baidu,baidu|百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
9 | |`MP-TOUTIAO`|platform-mp-toutiao,platform-toutiao,platform-mp-bytedance,platform-bytedance,mp-toutiao,toutiao,mp-bytedance,bytedance|字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
10 | |`MP-QQ`|platform-mp-qq,platform-qq,mp-qq,qq|QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
11 | |`MP-360`|platform-mp-360,platform-360,mp-360,360|360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
12 | |`MP`|platform-mp,mp|小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
13 | |`QUICKAPP-WEBVIEW`|platform-quickapp,platform-quickapp-webview,quickapp,quickapp-webview|快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
14 | |`QUICKAPP-WEBVIEW-UNION`|platform-quickapp-union,platform-quickapp-webview-union,quickapp-union,quickapp-webview-union|快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
15 | |`QUICKAPP-WEBVIEW-HUAWEI`|platform-quickapp-huawei,platform-quickapp-webview-huawei,quickapp-huawei,quickapp-webview-huawei|快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
16 | |`/* #ifdef $1 */,$2,/* #endif */`|#ifdef,ifdef|条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/platform。|
17 | |`/* #ifndef $1 */,$2,/* #endif */`|#ifndef,ifndef|条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/platform。|
18 | |`/* #endif */`|#endif,endif|结束条件编译。更多信息查看 https://uniapp.dcloud.io/platform。|
19 | |`var(--status-bar-height)`|--status-bar-height,var(--status-bar-height)|系统状态栏高度变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。|
20 | |`var(--window-top)`|--window-top,var(--window-top)|内容区域距离顶部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。|
21 | |`var(--window-bottom)`|--window-bottom,var(--window-bottom)|内容区域距离底部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。|
22 |
--------------------------------------------------------------------------------
/snippets/javascriptreact.json:
--------------------------------------------------------------------------------
1 | {
2 | "define module": {
3 | "prefix": "define",
4 | "body": [
5 | "define([",
6 | "\t'require',",
7 | "\t'${1:dependency}'",
8 | "], function(require, ${2:factory}) {",
9 | "\t'use strict';",
10 | "\t$0",
11 | "});"
12 | ],
13 | "description": "define module"
14 | },
15 | "For Loop": {
16 | "prefix": "for",
17 | "body": [
18 | "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
19 | "\tvar ${3:element} = ${2:array}[${1:index}];",
20 | "\t$0",
21 | "}"
22 | ],
23 | "description": "For Loop"
24 | },
25 | "For-Each Loop": {
26 | "prefix": "foreach",
27 | "body": [
28 | "${1:array}.forEach(function(${2:element}) {",
29 | "\t$0",
30 | "}, this);"
31 | ],
32 | "description": "For-Each Loop"
33 | },
34 | "For-In Loop": {
35 | "prefix": "forin",
36 | "body": [
37 | "for (var ${1:key} in ${2:object}) {",
38 | "\tif (${2:object}.hasOwnProperty(${1:key})) {",
39 | "\t\tvar ${3:element} = ${2:object}[${1:key}];",
40 | "\t\t$0",
41 | "\t}",
42 | "}"
43 | ],
44 | "description": "For-In Loop"
45 | },
46 | "Function Statement": {
47 | "prefix": "function",
48 | "body": [
49 | "function ${1:name}(${2:params}) {",
50 | "\t$0",
51 | "}"
52 | ],
53 | "description": "Function Statement"
54 | },
55 | "If Statement": {
56 | "prefix": "if",
57 | "body": [
58 | "if (${1:condition}) {",
59 | "\t$0",
60 | "}"
61 | ],
62 | "description": "If Statement"
63 | },
64 | "If-Else Statement": {
65 | "prefix": "ifelse",
66 | "body": [
67 | "if (${1:condition}) {",
68 | "\t$0",
69 | "} else {",
70 | "\t",
71 | "}"
72 | ],
73 | "description": "If-Else Statement"
74 | },
75 | "New Statement": {
76 | "prefix": "new",
77 | "body": [
78 | "var ${1:name} = new ${2:type}(${3:arguments});$0"
79 | ],
80 | "description": "New Statement"
81 | },
82 | "Switch Statement": {
83 | "prefix": "switch",
84 | "body": [
85 | "switch (${1:key}) {",
86 | "\tcase ${2:value}:",
87 | "\t\t$0",
88 | "\t\tbreak;",
89 | "",
90 | "\tdefault:",
91 | "\t\tbreak;",
92 | "}"
93 | ],
94 | "description": "Switch Statement"
95 | },
96 | "While Statement": {
97 | "prefix": "while",
98 | "body": [
99 | "while (${1:condition}) {",
100 | "\t$0",
101 | "}"
102 | ],
103 | "description": "While Statement"
104 | },
105 | "Do-While Statement": {
106 | "prefix": "dowhile",
107 | "body": [
108 | "do {",
109 | "\t$0",
110 | "} while (${1:condition});"
111 | ],
112 | "description": "Do-While Statement"
113 | },
114 | "Try-Catch Statement": {
115 | "prefix": "trycatch",
116 | "body": [
117 | "try {",
118 | "\t$0",
119 | "} catch (${2:error}) {",
120 | "\t",
121 | "}"
122 | ],
123 | "description": "Try-Catch Statement"
124 | },
125 | "Set Timeout Function": {
126 | "prefix": "settimeout",
127 | "body": [
128 | "setTimeout(function() {",
129 | "\t$0",
130 | "}, ${1:timeout});"
131 | ],
132 | "description": "Set Timeout Function"
133 | },
134 | "Relative Reference to another File": {
135 | "prefix": "reference",
136 | "body": [
137 | "/// $0"
138 | ],
139 | "description": "Relative Reference to another File"
140 | }
141 | }
--------------------------------------------------------------------------------
/snippets/vue-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "Vue v-for": {
3 | "prefix": "vfor",
4 | "body": [
5 | "<${1:div} v-for=\"${2:item} in ${2:item}s\" :key=\"${2:item}.id\">",
6 | "\t{{ ${2:item} }}",
7 | "${1:div}>"
8 | ],
9 | "description": "vfor statement"
10 | },
11 | "Vue v-model Directive": {
12 | "prefix": "vmodel",
13 | "body": [
14 | ""
15 | ],
16 | "description": "v-model directive"
17 | },
18 | "Vue v-model Number Directive": {
19 | "prefix": "vmodel-num",
20 | "body": [
21 | ""
22 | ],
23 | "description": "v-model directive number input"
24 | },
25 | "Vue v-on Shortcut Directive": {
26 | "prefix": "von",
27 | "body": [
28 | "@click=\"${1:handler}(${2:arg}, $event)\""
29 | ],
30 | "description": "v-on click handler with arguments"
31 | },
32 | "Vue Component with Props Binding": {
33 | "prefix": "vel-props",
34 | "body": [
35 | "<${1:component} :${1:propName}=\"${0}\">${1:component}>"
36 | ],
37 | "description": "component element with props"
38 | },
39 | "Vue Image Source Binding": {
40 | "prefix": "vsrc",
41 | "body": [
42 | "
"
43 | ],
44 | "description": "image source binding"
45 | },
46 | "Vue Style Binding": {
47 | "prefix": "vstyle",
48 | "body": [
49 | "<${1:div} :style=\"{ fontSize: ${2:data} + 'px' }\">${1:div}>"
50 | ],
51 | "description": "vue inline style binding"
52 | },
53 | "Vue Style Binding Object": {
54 | "prefix": "vstyle-obj",
55 | "body": [
56 | "<${1:div} :style=\"[${2:styleObjectA}, ${3:styleObjectB]}\">${1:div}>"
57 | ],
58 | "description": "vue inline style binding, objects"
59 | },
60 | "Vue Class Binding": {
61 | "prefix": "vclass",
62 | "body": [
63 | "<${1:div} :class=\"{ ${2:className}: ${3:data} }\">${1:div}>"
64 | ],
65 | "description": "vue class binding"
66 | },
67 | "Vue Class Binding Object": {
68 | "prefix": "vclass-obj",
69 | "body": [
70 | "<${1:div} :class=\"[${2:classNameA}, ${3:classNameB}]\">${1:div}>"
71 | ],
72 | "description": "vue class binding"
73 | },
74 | "Vue Multiple Conditional Class Bindings": {
75 | "prefix": "vclass-obj-mult",
76 | "body": [
77 | "<${1:div} :class=\"[${2:classNameA}, {${3:classNameB} : ${4:condition}}]\">${1:div}>"
78 | ],
79 | "description": "vue multiple conditional class bindings"
80 | },
81 | "Vue Transition Component with JavaScript Hooks": {
82 | "prefix": "vanim",
83 | "body": [
84 | "",
92 | "",
93 | ""
94 | ],
95 | "description": "transition component js hooks"
96 | },
97 | "Vue Nuxt Routing Link": {
98 | "prefix": "vnuxtl",
99 | "body": [
100 | "${1:page}"
101 | ],
102 | "description": "nuxt routing link"
103 | }
104 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "uni-app",
3 | "displayName": "Uni App Snippets",
4 | "description": "Support commonly used code snippets in Hbuilder and HbuilderX.",
5 | "version": "0.0.3",
6 | "engines": {
7 | "vscode": "^1.52.0"
8 | },
9 | "icon": "images/uni-app.jpg",
10 | "author": {
11 | "name": "Eno Yao",
12 | "email": "kalone.cool@gmail.com",
13 | "url": "https://github.com/Wscats"
14 | },
15 | "publisher": "Wscats",
16 | "keywords": [
17 | "uniapp",
18 | "uni-app",
19 | "mui",
20 | "plusjs",
21 | "hbuilder"
22 | ],
23 | "categories": [
24 | "Snippets"
25 | ],
26 | "scripts": {
27 | "package": "vsce package"
28 | },
29 | "contributes": {
30 | "snippets": [
31 | {
32 | "language": "html",
33 | "path": "./snippets/html.json"
34 | },
35 | {
36 | "language": "html",
37 | "path": "./snippets/mui 2.json"
38 | },
39 | {
40 | "language": "vue",
41 | "path": "./snippets/nml.json"
42 | },
43 | {
44 | "language": "vue",
45 | "path": "./snippets/ux.json"
46 | },
47 | {
48 | "language": "vue",
49 | "path": "./snippets/vue.json"
50 | },
51 | {
52 | "language": "vue",
53 | "path": "./snippets/uni_vue_tag.json"
54 | },
55 | {
56 | "language": "vue",
57 | "path": "./snippets/vue-template.json"
58 | },
59 | {
60 | "language": "vue",
61 | "path": "./snippets/condition_comment 2.json"
62 | },
63 | {
64 | "language": "html",
65 | "path": "./snippets/condition_comment 2.json"
66 | },
67 | {
68 | "language": "javascript",
69 | "path": "./snippets/undisplay.json"
70 | },
71 | {
72 | "language": "javascript",
73 | "path": "./snippets/javascript 2.json"
74 | },
75 | {
76 | "language": "typescript",
77 | "path": "./snippets/javascript 2.json"
78 | },
79 | {
80 | "language": "javascript",
81 | "path": "./snippets/mui.json"
82 | },
83 | {
84 | "language": "javascript",
85 | "path": "./snippets/uni_vue_js.json"
86 | },
87 | {
88 | "language": "javascriptreact",
89 | "path": "./snippets/javascriptreact.json"
90 | },
91 | {
92 | "language": "javascript",
93 | "path": "./snippets/vue-script.json"
94 | },
95 | {
96 | "language": "javascript",
97 | "path": "./snippets/vue-script 2.json"
98 | },
99 | {
100 | "language": "javascript",
101 | "path": "./snippets/condition_comment.json"
102 | },
103 | {
104 | "language": "typescript",
105 | "path": "./snippets/condition_comment.json"
106 | },
107 | {
108 | "language": "vue-html",
109 | "path": "./snippets/vue-html.json"
110 | },
111 | {
112 | "language": "css",
113 | "path": "./snippets/css.json"
114 | },
115 | {
116 | "language": "less",
117 | "path": "./snippets/css.json"
118 | },
119 | {
120 | "language": "scss",
121 | "path": "./snippets/css.json"
122 | },
123 | {
124 | "language": "scss",
125 | "path": "./snippets/css.json"
126 | },
127 | {
128 | "language": "javascript",
129 | "path": "./snippets/javascript.json"
130 | },
131 | {
132 | "language": "typescript",
133 | "path": "./snippets/javascript.json"
134 | }
135 | ]
136 | }
137 | }
--------------------------------------------------------------------------------
/snippets/vue-script 2.json:
--------------------------------------------------------------------------------
1 | {
2 | "Vue Data": {
3 | "prefix": "vdata",
4 | "body": [
5 | "data() {",
6 | "\treturn {",
7 | "\t\t${1:key}: ${2:value}",
8 | "\t}",
9 | "},"
10 | ],
11 | "description": "Vue Component Data"
12 | },
13 | "Vue Methods": {
14 | "prefix": "vmethod",
15 | "body": [
16 | "methods: {",
17 | "\t${1:name}() {",
18 | "\t\t${0}",
19 | "\t}",
20 | "},"
21 | ],
22 | "description": "vue method"
23 | },
24 | "Vue Computed": {
25 | "prefix": "vcomputed",
26 | "body": [
27 | "computed: {",
28 | "\t${1:name}() {",
29 | "\t\treturn this.\\${2:data} ${0}",
30 | "\t}",
31 | "},"
32 | ],
33 | "description": "computed value"
34 | },
35 | "Vue Watchers": {
36 | "prefix": "vwatcher",
37 | "body": [
38 | "watch: {",
39 | "\t${1:data}(${2:newValue}, ${3:oldValue}) {",
40 | "\t\t${0}",
41 | "\t}",
42 | "},"
43 | ],
44 | "description": "vue watcher"
45 | },
46 | "Vue Props with Default": {
47 | "prefix": "vprops",
48 | "body": [
49 | "props: {",
50 | "\t${1:propName}: {",
51 | "\t\ttype: ${2:Number},",
52 | "\t\tdefault: ${0}",
53 | "\t},",
54 | "},"
55 | ],
56 | "description": "Vue Props with Default"
57 | },
58 | "Vue Import File": {
59 | "prefix": "vimport",
60 | "body": [
61 | "import ${1:New} from './components/${1:New}.vue';"
62 | ],
63 | "description": "Import one component into another"
64 | },
65 | "Vue Import into the Component": {
66 | "prefix": "vcomponents",
67 | "body": [
68 | "components: {",
69 | "\t${1:New},",
70 | "}"
71 | ],
72 | "description": "Import one component into another, within export statement"
73 | },
74 | "Vue Import Export": {
75 | "prefix": "vimport-export",
76 | "body": [
77 | "import ${1:Name} from './components/${1:Name}.vue'",
78 | "",
79 | "export default {",
80 | "\tcomponents: {",
81 | "\t\t${1:Name}",
82 | "\t},",
83 | "}"
84 | ],
85 | "description": "import a component and include it in export default"
86 | },
87 | "Vue Filter": {
88 | "prefix": "vfilter",
89 | "body": [
90 | "filters: {",
91 | "\t${1:fnName}: function(${2:value}) {",
92 | "\t\treturn ${2:value}${0};",
93 | "\t}",
94 | "}"
95 | ],
96 | "description": "vue filter"
97 | },
98 | "Vue Mixin": {
99 | "prefix": "vmixin",
100 | "body": [
101 | "const ${1:mixinName} = {",
102 | "\tmounted() {",
103 | "\t\tconsole.log('hello from mixin!')",
104 | "\t},",
105 | "}"
106 | ],
107 | "description": "vue mixin"
108 | },
109 | "Vue Use Mixin": {
110 | "prefix": "vmixin-use",
111 | "body": [
112 | "mixins: [${1:mixinName}]"
113 | ],
114 | "description": "vue use mixin"
115 | },
116 | "Vue Custom Directive": {
117 | "prefix": "vc-direct",
118 | "body": [
119 | "Vue.directive('${1:directiveName}', {",
120 | "\tbind(el, binding, vnode) {",
121 | "\t\tel.style.${2:arg} = binding.value.${2:arg};",
122 | "\t}",
123 | "});"
124 | ],
125 | "description": "vue custom directive"
126 | },
127 | "Vue Import Library": {
128 | "prefix": "vimport-lib",
129 | "body": [
130 | "import { ${1:libName} } from '${1:libName}'"
131 | ],
132 | "description": "import a library"
133 | },
134 | "Vue Import GSAP": {
135 | "prefix": "vimport-gsap",
136 | "body": [
137 | "import { TimelineMax, ${1:Ease} } from 'gsap'"
138 | ],
139 | "description": "component methods options that dispatch an action from vuex store."
140 | },
141 | "Vue Transition Methods with JavaScript Hooks": {
142 | "prefix": "vanimhook-js",
143 | "body": [
144 | "beforeEnter(el) {",
145 | "\tconsole.log('beforeEnter');",
146 | "},",
147 | "enter(el, done) {",
148 | "\tconsole.log('enter');",
149 | "\tdone();",
150 | "},",
151 | "beforeLeave(el) {",
152 | "\tconsole.log('beforeLeave');",
153 | "},",
154 | "leave(el, done) {",
155 | "\tconsole.log('leave');",
156 | "\tdone();",
157 | "},"
158 | ],
159 | "description": "transition component js hooks"
160 | },
161 | "Vue Commit Vuex Store in Methods": {
162 | "prefix": "vcommit",
163 | "body": [
164 | "${1:mutationName}() {",
165 | "\tthis.\\$store.commit('${1:mutationName}', ${2:payload})",
166 | "}"
167 | ],
168 | "description": "commit to vuex store in methods for mutation"
169 | },
170 | "Vue Dispatch Vuex Store in Methods": {
171 | "prefix": "vdispatch",
172 | "body": [
173 | "${1:actionName}() {",
174 | "\tthis.\\$store.dispatch('${1:actionName}', ${2:payload})",
175 | "}"
176 | ],
177 | "description": "dispatch to vuex store in methods for action"
178 | },
179 | "Incrementer": {
180 | "prefix": "vinc",
181 | "body": [
182 | "return ${1:this.num} += ${2:1}"
183 | ],
184 | "description": "increment"
185 | },
186 | "Decrementer": {
187 | "prefix": "vdec",
188 | "body": [
189 | "return ${1:this.num} -= ${2:1}"
190 | ],
191 | "description": "decrement"
192 | },
193 | "Unit Test": {
194 | "prefix": "vtest",
195 | "body": [
196 | "import Vue from 'vue'",
197 | "import ${1:HelloWorld} from './components/${1:HelloWorld}'",
198 | "",
199 | "describe('${1:HelloWorld}.vue', () => {",
200 | "\tit('${2:should render correct contents}', () => {",
201 | "\t\tconst Constructor = Vue.extend(${1:HelloWorld})",
202 | "\t\tconst vm = new Constructor().$mount()",
203 | "\t\texpect(vm.$el.querySelector('.hello h1').textContent)",
204 | "\t\t\t.to.equal(${3:'Welcome to Your Vue.js App'})",
205 | "\t})",
206 | "})"
207 | ],
208 | "description": "unit test component"
209 | }
210 | }
--------------------------------------------------------------------------------
/snippets/css.json:
--------------------------------------------------------------------------------
1 | {
2 | "uni-app APP 平台": {
3 | "prefix": [
4 | "platform-app",
5 | "platform-app-plus",
6 | "app",
7 | "app-plus"
8 | ],
9 | "body": [
10 | "APP-PLUS"
11 | ],
12 | "description": "APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
13 | },
14 | "uni-app APP-NVUE 平台": {
15 | "prefix": [
16 | "platform-app-nvue",
17 | "platform-app-plus-nvue",
18 | "app-nvue",
19 | "app-plus-nvue"
20 | ],
21 | "body": [
22 | "APP-NVUE"
23 | ],
24 | "description": "APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
25 | },
26 | "uni-app H5 平台": {
27 | "prefix": [
28 | "platform-h5",
29 | "h5"
30 | ],
31 | "body": [
32 | "H5"
33 | ],
34 | "description": "H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
35 | },
36 | "uni-app 微信小程序平台": {
37 | "prefix": [
38 | "platform-mp-weixin",
39 | "platform-weixin",
40 | "platform-mp-wechat",
41 | "platform-wechat",
42 | "mp-weixin",
43 | "weixin",
44 | "mp-wechat",
45 | "wechat"
46 | ],
47 | "body": [
48 | "MP-WEIXIN"
49 | ],
50 | "description": "微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
51 | },
52 | "uni-app 支付宝小程序平台": {
53 | "prefix": [
54 | "platform-mp-alipay",
55 | "platform-alipay",
56 | "platform-mp-ali",
57 | "platform-ali",
58 | "mp-alipay",
59 | "alipay",
60 | "mp-ali",
61 | "ali"
62 | ],
63 | "body": [
64 | "MP-ALIPAY"
65 | ],
66 | "description": "支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
67 | },
68 | "uni-app 百度小程序平台": {
69 | "prefix": [
70 | "platform-mp-baidu",
71 | "platform-baidu",
72 | "mp-baidu",
73 | "baidu"
74 | ],
75 | "body": [
76 | "MP-BAIDU"
77 | ],
78 | "description": "百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
79 | },
80 | "uni-app 字节跳动小程序平台": {
81 | "prefix": [
82 | "platform-mp-toutiao",
83 | "platform-toutiao",
84 | "platform-mp-bytedance",
85 | "platform-bytedance",
86 | "mp-toutiao",
87 | "toutiao",
88 | "mp-bytedance",
89 | "bytedance"
90 | ],
91 | "body": [
92 | "MP-TOUTIAO"
93 | ],
94 | "description": "字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
95 | },
96 | "uni-app QQ 小程序平台": {
97 | "prefix": [
98 | "platform-mp-qq",
99 | "platform-qq",
100 | "mp-qq",
101 | "qq"
102 | ],
103 | "body": [
104 | "MP-QQ"
105 | ],
106 | "description": "QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
107 | },
108 | "uni-app 360 小程序平台": {
109 | "prefix": [
110 | "platform-mp-360",
111 | "platform-360",
112 | "mp-360",
113 | "360"
114 | ],
115 | "body": [
116 | "MP-360"
117 | ],
118 | "description": "360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
119 | },
120 | "uni-app 小程序平台": {
121 | "prefix": [
122 | "platform-mp",
123 | "mp"
124 | ],
125 | "body": [
126 | "MP"
127 | ],
128 | "description": "小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
129 | },
130 | "uni-app 快应用通用平台": {
131 | "prefix": [
132 | "platform-quickapp",
133 | "platform-quickapp-webview",
134 | "quickapp",
135 | "quickapp-webview"
136 | ],
137 | "body": [
138 | "QUICKAPP-WEBVIEW"
139 | ],
140 | "description": "快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
141 | },
142 | "uni-app 快应用联盟平台": {
143 | "prefix": [
144 | "platform-quickapp-union",
145 | "platform-quickapp-webview-union",
146 | "quickapp-union",
147 | "quickapp-webview-union"
148 | ],
149 | "body": [
150 | "QUICKAPP-WEBVIEW-UNION"
151 | ],
152 | "description": "快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
153 | },
154 | "uni-app 快应用华为平台": {
155 | "prefix": [
156 | "platform-quickapp-huawei",
157 | "platform-quickapp-webview-huawei",
158 | "quickapp-huawei",
159 | "quickapp-webview-huawei"
160 | ],
161 | "body": [
162 | "QUICKAPP-WEBVIEW-HUAWEI"
163 | ],
164 | "description": "快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。"
165 | },
166 | "uni-app 条件编译,处理某平台": {
167 | "prefix": [
168 | "#ifdef",
169 | "ifdef"
170 | ],
171 | "body": [
172 | "/* #ifdef $1 */",
173 | "$2",
174 | "/* #endif */"
175 | ],
176 | "description": "条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/platform。"
177 | },
178 | "uni-app 条件编译,排除某平台": {
179 | "prefix": [
180 | "#ifndef",
181 | "ifndef"
182 | ],
183 | "body": [
184 | "/* #ifndef $1 */",
185 | "$2",
186 | "/* #endif */"
187 | ],
188 | "description": "条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/platform。"
189 | },
190 | "uni-app 结束条件编译": {
191 | "prefix": [
192 | "#endif",
193 | "endif"
194 | ],
195 | "body": [
196 | "/* #endif */"
197 | ],
198 | "description": "结束条件编译。更多信息查看 https://uniapp.dcloud.io/platform。"
199 | },
200 | "uni-app 系统状态栏高度变量": {
201 | "prefix": [
202 | "--status-bar-height",
203 | "var(--status-bar-height)"
204 | ],
205 | "body": [
206 | "var(--status-bar-height)"
207 | ],
208 | "description": "系统状态栏高度变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。"
209 | },
210 | "uni-app 内容区域距离顶部的距离变量": {
211 | "prefix": [
212 | "--window-top",
213 | "var(--window-top)"
214 | ],
215 | "body": [
216 | "var(--window-top)"
217 | ],
218 | "description": "内容区域距离顶部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。"
219 | },
220 | "uni-app 内容区域距离底部的距离变量": {
221 | "prefix": [
222 | "--window-bottom",
223 | "var(--window-bottom)"
224 | ],
225 | "body": [
226 | "var(--window-bottom)"
227 | ],
228 | "description": "内容区域距离底部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css%e5%8f%98%e9%87%8f。"
229 | }
230 | }
--------------------------------------------------------------------------------
/snippets/vue-script.json:
--------------------------------------------------------------------------------
1 | {
2 | "Vue Data": {
3 | "prefix": "vdata",
4 | "body": [
5 | "data() {",
6 | "\treturn {",
7 | "\t\t${1:key}: ${2:value}",
8 | "\t}",
9 | "},"
10 | ],
11 | "scope": "vue.property.js",
12 | "description": "Vue Component Data"
13 | },
14 | "redirectTo({...})": {
15 | "prefix": "redirectTo",
16 | "body": [
17 | "redirectTo({",
18 | "\turl: '$1'",
19 | "});$0"
20 | ],
21 | "scope": "uni.method.js"
22 | },
23 | "Vue Components": {
24 | "prefix": "vcomponents",
25 | "body": [
26 | "components: {",
27 | "\t$1",
28 | "},"
29 | ],
30 | "scope": "vue.property.js",
31 | "description": "注册vue组件"
32 | },
33 | "Vue Methods": {
34 | "prefix": "vmethod",
35 | "body": [
36 | "methods: {",
37 | "\t${1:name}() {",
38 | "\t\t${0}",
39 | "\t}",
40 | "},"
41 | ],
42 | "scope": "vue.property.js",
43 | "description": "vue method"
44 | },
45 | "Vue Computed": {
46 | "prefix": "vcomputed",
47 | "body": [
48 | "computed: {",
49 | "\t${1:name}() {",
50 | "\t\treturn this.${2:data} ${0}",
51 | "\t}",
52 | "},"
53 | ],
54 | "scope": "vue.property.js",
55 | "description": "computed value"
56 | },
57 | "Vue Watchers": {
58 | "prefix": "vwatcher",
59 | "body": [
60 | "watch: {",
61 | "\t${1:data}(${2:newValue}, ${3:oldValue}) {",
62 | "\t\t${0}",
63 | "\t}",
64 | "},"
65 | ],
66 | "scope": "vue.property.js",
67 | "description": "vue watcher"
68 | },
69 | "Vue Props with Default": {
70 | "prefix": "vprops",
71 | "body": [
72 | "props: {",
73 | "\t${1:propName}: {",
74 | "\t\ttype: ${2:Number},",
75 | "\t\tdefault: ${0}",
76 | "\t},",
77 | "},"
78 | ],
79 | "scope": "vue.property.js",
80 | "description": "Vue Props with Default"
81 | },
82 | "Vue Import File": {
83 | "prefix": "vimport",
84 | "body": [
85 | "import ${1:New} from '/components/${1:New}.vue';"
86 | ],
87 | "description": "Import one component into another"
88 | },
89 | "Vue Import into the Component": {
90 | "prefix": "vcomponents",
91 | "body": [
92 | "components: {",
93 | "\t${1:New},",
94 | "}"
95 | ],
96 | "description": "Import one component into another, within export statement"
97 | },
98 | "Vue Import Export": {
99 | "prefix": "vimport-export",
100 | "body": [
101 | "import ${1:Name} from './components/${1:Name}.vue'",
102 | "",
103 | "export default {",
104 | "\tcomponents: {",
105 | "\t\t${1:Name}",
106 | "\t},",
107 | "}"
108 | ],
109 | "description": "import a component and include it in export default"
110 | },
111 | "Vue Filter": {
112 | "prefix": "vfilter",
113 | "body": [
114 | "filters: {",
115 | "\t${1:fnName}: function(${2:value}) {",
116 | "\t\treturn ${2:value}${0};",
117 | "\t}",
118 | "}"
119 | ],
120 | "scope": "vue.property.js",
121 | "description": "vue filter"
122 | },
123 | "Vue Mixin": {
124 | "prefix": "vmixin",
125 | "body": [
126 | "const ${1:mixinName} = {",
127 | "\tmounted() {",
128 | "\t\tconsole.log('hello from mixin!')",
129 | "\t},",
130 | "}"
131 | ],
132 | "description": "vue mixin"
133 | },
134 | "Vue Use Mixin": {
135 | "prefix": "vmixin-use",
136 | "body": [
137 | "mixins: [${1:mixinName}]"
138 | ],
139 | "description": "vue use mixin"
140 | },
141 | "Vue Custom Directive": {
142 | "prefix": "vc-direct",
143 | "body": [
144 | "Vue.directive('${1:directiveName}', {",
145 | "\tbind(el, binding, vnode) {",
146 | "\t\tel.style.${2:arg} = binding.value.${2:arg};",
147 | "\t}",
148 | "});"
149 | ],
150 | "description": "vue custom directive"
151 | },
152 | "Vue Import Library": {
153 | "prefix": "vimport-lib",
154 | "body": [
155 | "import { ${1:libName} } from '${1:libName}'"
156 | ],
157 | "description": "import a library"
158 | },
159 | "Vue Import GSAP": {
160 | "prefix": "vimport-gsap",
161 | "body": [
162 | "import { TimelineMax, ${1:Ease} } from 'gsap'"
163 | ],
164 | "description": "component methods options that dispatch an action from vuex store."
165 | },
166 | "Vue Transition Methods with JavaScript Hooks": {
167 | "prefix": "vanimhook-js",
168 | "body": [
169 | "beforeEnter(el) {",
170 | "\tconsole.log('beforeEnter');",
171 | "},",
172 | "enter(el, done) {",
173 | "\tconsole.log('enter');",
174 | "\tdone();",
175 | "},",
176 | "beforeLeave(el) {",
177 | "\tconsole.log('beforeLeave');",
178 | "},",
179 | "leave(el, done) {",
180 | "\tconsole.log('leave');",
181 | "\tdone();",
182 | "},"
183 | ],
184 | "description": "transition component js hooks"
185 | },
186 | "Vue Commit Vuex Store in Methods": {
187 | "prefix": "vcommit",
188 | "body": [
189 | "${1:mutationName}() {",
190 | "\tthis.\\$store.commit('${1:mutationName}', ${2:payload})",
191 | "}"
192 | ],
193 | "scope": "vue.property.js",
194 | "description": "commit to vuex store in methods for mutation"
195 | },
196 | "Vue Dispatch Vuex Store in Methods": {
197 | "prefix": "vdispatch",
198 | "body": [
199 | "${1:actionName}() {",
200 | "\tthis.\\$store.dispatch('${1:actionName}', ${2:payload})",
201 | "}"
202 | ],
203 | "scope": "vue.property.js",
204 | "description": "dispatch to vuex store in methods for action"
205 | },
206 | "Incrementer": {
207 | "prefix": "vinc",
208 | "body": [
209 | "return ${1:this.num} += ${2:1}"
210 | ],
211 | "description": "increment"
212 | },
213 | "Decrementer": {
214 | "prefix": "vdec",
215 | "body": [
216 | "return ${1:this.num} -= ${2:1}"
217 | ],
218 | "description": "decrement"
219 | },
220 | "Unit Test": {
221 | "prefix": "vtest",
222 | "body": [
223 | "import Vue from 'vue'",
224 | "import ${1:HelloWorld} from './components/${1:HelloWorld}'",
225 | "",
226 | "describe('${1:HelloWorld}.vue', () => {",
227 | "\tit('${2:should render correct contents}', () => {",
228 | "\t\tconst Constructor = Vue.extend(${1:HelloWorld})",
229 | "\t\tconst vm = new Constructor().$mount()",
230 | "\t\texpect(vm.$el.querySelector('.hello h1').textContent)",
231 | "\t\t\t.to.equal(${3:'Welcome to Your Vue.js App'})",
232 | "\t})",
233 | "})"
234 | ],
235 | "description": "unit test component"
236 | }
237 | }
--------------------------------------------------------------------------------
/snippets/uni_vue_js.json:
--------------------------------------------------------------------------------
1 | {
2 | "uRequest": {
3 | "body": [
4 | "uni.request({",
5 | "\turl: '$1',",
6 | "\tmethod: 'GET$2',",
7 | "\tdata: {$3},",
8 | "\tsuccess: res => {$0},",
9 | "\tfail: () => {},",
10 | "\tcomplete: () => {}",
11 | "});"
12 | ],
13 | "triggerAssist": false,
14 | "prefix": "urequest"
15 | },
16 | "uGetLocation": {
17 | "body": [
18 | "uni.getLocation({",
19 | "\ttype: 'wgs84',",
20 | "\tsuccess: res => {$0}",
21 | "\tfail: () => {},",
22 | "\tcomplete: () => {}",
23 | "});"
24 | ],
25 | "triggerAssist": false,
26 | "prefix": "ugetlocation"
27 | },
28 | "uShowToast": {
29 | "body": [
30 | "uni.showToast({",
31 | "\ttitle: '$1'",
32 | "});"
33 | ],
34 | "triggerAssist": false,
35 | "prefix": "ushowtoast"
36 | },
37 | "uShowToastNoIcon": {
38 | "body": [
39 | "uni.showToast({",
40 | "\ttitle: '$1',",
41 | "\ticon: 'none'",
42 | "});"
43 | ],
44 | "triggerAssist": false,
45 | "prefix": "ushowtoastnoicon"
46 | },
47 | "uShowLoading": {
48 | "body": [
49 | "uni.showLoading({",
50 | "\ttitle: '$1',",
51 | "\tmask: false",
52 | "});"
53 | ],
54 | "triggerAssist": false,
55 | "prefix": "ushowloading"
56 | },
57 | "uShowModal": {
58 | "body": [
59 | "uni.showModal({",
60 | "\ttitle: '$1',",
61 | "\tcontent: '$2',",
62 | "\tshowCancel: false$3,",
63 | "\tcancelText: '$4',",
64 | "\tconfirmText: '$5',",
65 | "\tsuccess: res => {$0},",
66 | "\tfail: () => {},",
67 | "\tcomplete: () => {}",
68 | "});"
69 | ],
70 | "triggerAssist": false,
71 | "prefix": "ushowmodal"
72 | },
73 | "uAlert": {
74 | "body": [
75 | "uni.showModal({",
76 | "\tcontent: '$1',",
77 | "\tshowCancel: false",
78 | "});"
79 | ],
80 | "triggerAssist": false,
81 | "prefix": "ualert"
82 | },
83 | "uConfirm": {
84 | "body": [
85 | "uni.showModal({",
86 | "\tcontent: '$1',",
87 | "\tsuccess: function (res) {",
88 | "\t\tif (res.confirm) {",
89 | "\t\t\t$2",
90 | "\t\t} else if (res.cancel) {",
91 | "\t\t\t$3",
92 | "\t\t}",
93 | "\t}",
94 | "});"
95 | ],
96 | "triggerAssist": false,
97 | "prefix": "uconfirm"
98 | },
99 | "uShowActionSheet": {
100 | "body": [
101 | "uni.showActionSheet({",
102 | "\titemList: $1,",
103 | "\tsuccess: res => {},",
104 | "\tfail: () => {},",
105 | "\tcomplete: () => {}",
106 | "});"
107 | ],
108 | "triggerAssist": false,
109 | "prefix": "ushowactionsheet"
110 | },
111 | "uNavigateTo": {
112 | "body": [
113 | "uni.navigateTo({",
114 | "\turl: '$1',",
115 | "\tsuccess: res => {},",
116 | "\tfail: () => {},",
117 | "\tcomplete: () => {}",
118 | "});"
119 | ],
120 | "triggerAssist": false,
121 | "prefix": "unavigateto"
122 | },
123 | "uRedirectTo": {
124 | "body": [
125 | "uni.redirectTo({",
126 | "\turl: '$1',",
127 | "\tsuccess: res => {},",
128 | "\tfail: () => {},",
129 | "\tcomplete: () => {}",
130 | "});"
131 | ],
132 | "triggerAssist": false,
133 | "prefix": "uredirectto"
134 | },
135 | "uNavigateBack": {
136 | "body": [
137 | "uni.navigateBack({",
138 | "\tdelta: $1",
139 | "});"
140 | ],
141 | "triggerAssist": false,
142 | "prefix": "unavigateback"
143 | },
144 | "uStartPullDownRefresh": {
145 | "body": [
146 | "uni.startPullDownRefresh({",
147 | "\tsuccess: res => {},",
148 | "\tfail: () => {},",
149 | "\tcomplete: () => {}",
150 | "});"
151 | ],
152 | "triggerAssist": false,
153 | "prefix": "ustartpulldownrefresh"
154 | },
155 | "uStopPullDownRefresh": {
156 | "body": [
157 | "uni.stopPullDownRefresh();"
158 | ],
159 | "triggerAssist": false,
160 | "prefix": "ustoppulldownrefresh"
161 | },
162 | "uLogin": {
163 | "body": [
164 | "uni.login({",
165 | "\tprovider: '$1',",
166 | "\tsuccess: res => {},",
167 | "\tfail: () => {},",
168 | "\tcomplete: () => {}",
169 | "});"
170 | ],
171 | "triggerAssist": false,
172 | "prefix": "ulogin"
173 | },
174 | "uShare": {
175 | "body": [
176 | "uni.share({",
177 | "\tprovider: '$1',",
178 | "\ttype: 0$2,",
179 | "\ttitle: '$3',",
180 | "\thref: '$4',",
181 | "\timageUrl: '$5',",
182 | "\tsuccess: res => {},",
183 | "\tfail: () => {},",
184 | "\tcomplete: () => {}",
185 | "});"
186 | ],
187 | "triggerAssist": false,
188 | "prefix": "ushare"
189 | },
190 | "uRequestPayment": {
191 | "body": [
192 | "uni.requestPayment({",
193 | "\tprovider: '$1',",
194 | "\torderInfo: '$2',",
195 | "\tsuccess: res => {},",
196 | "\tfail: () => {},",
197 | "\tcomplete: () => {}",
198 | "});"
199 | ],
200 | "triggerAssist": false,
201 | "prefix": "urequestpayment"
202 | },
203 | "uPay": {
204 | "body": [
205 | "uni.requestPayment({",
206 | "\tprovider: '$1',",
207 | "\torderInfo: '$2',",
208 | "\tsuccess: res => {},",
209 | "\tfail: () => {},",
210 | "\tcomplete: () => {}",
211 | "});"
212 | ],
213 | "triggerAssist": false,
214 | "prefix": "upay"
215 | },
216 | "globalData": {
217 | "body": [
218 | "getApp().globalData."
219 | ],
220 | "triggerAssist": true,
221 | "prefix": "gdata"
222 | },
223 | "cdb": {
224 | "body": [
225 | "const db = uniCloud.database();",
226 | "$0"
227 | ],
228 | "prefix": "cdb",
229 | "project": "uni-app",
230 | "scope": "source.js"
231 | }
232 | }
--------------------------------------------------------------------------------
/snippets/ux.json:
--------------------------------------------------------------------------------
1 | {
2 | "q_template": {
3 | "body": [
4 | "",
5 | "\t",
6 | "\t\t$1",
7 | "\t
",
8 | ""
9 | ],
10 | "triggerAssist": false,
11 | "prefix": "q_template"
12 | },
13 | "q_template_root": {
14 | "body": [
15 | "",
16 | "\t",
17 | "\t\t$1",
18 | "\t
",
19 | "",
20 | "",
23 | ""
33 | ],
34 | "triggerAssist": false,
35 | "prefix": "q_template_root"
36 | },
37 | "q_style": {
38 | "body": [
39 | ""
42 | ],
43 | "triggerAssist": false,
44 | "prefix": "q_style"
45 | },
46 | "q_script": {
47 | "body": [
48 | ""
58 | ],
59 | "triggerAssist": false,
60 | "prefix": "q_script"
61 | },
62 | "q_tabs": {
63 | "body": [
64 | "",
65 | "\t",
66 | "\t\ttabContent1$1
",
67 | "\t\ttabContent2
",
68 | "\t\ttabContent3
",
69 | "\t",
70 | "\t",
71 | "\t\ttabBar1",
72 | "\t\ttabBar2",
73 | "\t\ttabBar3",
74 | "\t",
75 | ""
76 | ],
77 | "triggerAssist": false,
78 | "prefix": "q_tabs"
79 | },
80 | "q_tabs-bar": {
81 | "body": [
82 | "",
83 | "\t$1",
84 | ""
85 | ],
86 | "triggerAssist": false,
87 | "prefix": "q_tabs"
88 | },
89 | "q_tabs-content": {
90 | "body": [
91 | "",
92 | "\t$1",
93 | ""
94 | ],
95 | "triggerAssist": false,
96 | "prefix": "q_tabs-content"
97 | },
98 | "q_list": {
99 | "body": [
100 | "",
101 | "\t",
102 | "\t",
103 | "\t\t{{\\$item}}--{{\\$idx}}",
104 | "\t",
105 | "\t",
106 | "\t",
107 | "\t\t",
108 | "\t\t加载更多",
109 | "\t",
110 | "
"
111 | ],
112 | "triggerAssist": false,
113 | "prefix": "q_list"
114 | },
115 | "q_list-item": {
116 | "body": [
117 | "",
118 | "\t$2",
119 | ""
120 | ],
121 | "triggerAssist": false,
122 | "prefix": "q_list-item"
123 | },
124 | "q_div": {
125 | "body": [
126 | "
",
127 | "\t$1",
128 | "
"
129 | ],
130 | "triggerAssist": false,
131 | "prefix": "q_div"
132 | },
133 | "q_image": {
134 | "body": [
135 | ""
136 | ],
137 | "triggerAssist": false,
138 | "prefix": "q_image"
139 | },
140 | "q_input": {
141 | "body": [
142 | ""
143 | ],
144 | "triggerAssist": false,
145 | "prefix": "q_input"
146 | },
147 | "q_label": {
148 | "body": [
149 | "",
150 | "",
151 | ""
152 | ],
153 | "triggerAssist": false,
154 | "prefix": "q_label"
155 | },
156 | "q_picker": {
157 | "body": [
158 | ""
159 | ],
160 | "triggerAssist": false,
161 | "prefix": "q_picker"
162 | },
163 | "q_progress": {
164 | "body": [
165 | ""
166 | ],
167 | "triggerAssist": false,
168 | "prefix": "q_progress"
169 | },
170 | "q_refresh": {
171 | "body": [
172 | "",
173 | "\t$1",
174 | "\t\t{{componentName}}",
175 | "\t
",
176 | "\t",
177 | "\t\t",
178 | "\t
",
179 | ""
180 | ],
181 | "triggerAssist": false,
182 | "prefix": "q_refresh"
183 | },
184 | "q_slider": {
185 | "body": [
186 | ""
187 | ],
188 | "triggerAssist": false,
189 | "prefix": "q_slider"
190 | },
191 | "q_a": {
192 | "body": [
193 | ""
194 | ],
195 | "triggerAssist": false,
196 | "prefix": "q_a"
197 | },
198 | "q_stack": {
199 | "body": [
200 | "",
201 | "\t$1",
202 | ""
203 | ],
204 | "triggerAssist": false,
205 | "prefix": "q_stack"
206 | },
207 | "q_swiper": {
208 | "body": [
209 | "",
210 | "\tA",
211 | "\tB",
212 | "\tC",
213 | ""
214 | ],
215 | "triggerAssist": false,
216 | "prefix": "q_swiper"
217 | },
218 | "q_switch": {
219 | "body": [
220 | ""
221 | ],
222 | "triggerAssist": false,
223 | "prefix": "q_switch"
224 | },
225 | "q_text": {
226 | "body": [
227 | "$1"
228 | ],
229 | "triggerAssist": false,
230 | "prefix": "q_text"
231 | },
232 | "q_textarea": {
233 | "body": [
234 | ""
235 | ],
236 | "triggerAssist": false,
237 | "prefix": "q_textarea"
238 | },
239 | "q_video": {
240 | "body": [
241 | ""
242 | ],
243 | "triggerAssist": false,
244 | "prefix": "q_video"
245 | },
246 | "q_web": {
247 | "body": [
248 | ""
249 | ],
250 | "triggerAssist": false,
251 | "prefix": "q_web"
252 | },
253 | "q_import": {
254 | "body": [
255 | ""
256 | ],
257 | "triggerAssist": false,
258 | "prefix": "q_import"
259 | },
260 | "q_block": {
261 | "body": [
262 | "",
263 | "\t{{\\$item.name}}",
264 | ""
265 | ],
266 | "triggerAssist": false,
267 | "prefix": "q_block"
268 | }
269 | }
--------------------------------------------------------------------------------
/snippets/nml.json:
--------------------------------------------------------------------------------
1 | {
2 | "u_template": {
3 | "body": [
4 | "",
5 | "\t",
6 | "\t\t$1",
7 | "\t
",
8 | ""
9 | ],
10 | "triggerAssist": false,
11 | "prefix": "u_template"
12 | },
13 | "u_template_root": {
14 | "body": [
15 | "",
16 | "\t",
17 | "\t\t$1",
18 | "\t
",
19 | "",
20 | "",
23 | ""
33 | ],
34 | "triggerAssist": false,
35 | "prefix": "u_template_root"
36 | },
37 | "u_style": {
38 | "body": [
39 | ""
42 | ],
43 | "triggerAssist": false,
44 | "prefix": "u_style"
45 | },
46 | "u_script": {
47 | "body": [
48 | ""
58 | ],
59 | "triggerAssist": false,
60 | "prefix": "u_script"
61 | },
62 | "u_tabs": {
63 | "body": [
64 | "",
65 | "\t",
66 | "\t\ttabContent1$1
",
67 | "\t\ttabContent2
",
68 | "\t\ttabContent3
",
69 | "\t",
70 | "\t",
71 | "\t\ttabBar1",
72 | "\t\ttabBar2",
73 | "\t\ttabBar3",
74 | "\t",
75 | ""
76 | ],
77 | "triggerAssist": false,
78 | "prefix": "u_tabs"
79 | },
80 | "u_tabs-bar": {
81 | "body": [
82 | "",
83 | "\t$1",
84 | ""
85 | ],
86 | "triggerAssist": false,
87 | "prefix": "u_tabs"
88 | },
89 | "u_tabs-content": {
90 | "body": [
91 | "",
92 | "\t$1",
93 | ""
94 | ],
95 | "triggerAssist": false,
96 | "prefix": "u_tabs-content"
97 | },
98 | "u_list": {
99 | "body": [
100 | "",
101 | "\t",
102 | "\t",
103 | "\t\t{{\\$item}}--{{\\$idx}}",
104 | "\t",
105 | "\t",
106 | "\t",
107 | "\t\t",
108 | "\t\t加载更多",
109 | "\t",
110 | "
"
111 | ],
112 | "triggerAssist": false,
113 | "prefix": "u_list"
114 | },
115 | "u_list-item": {
116 | "body": [
117 | "",
118 | "\t$2",
119 | ""
120 | ],
121 | "triggerAssist": false,
122 | "prefix": "u_list-item"
123 | },
124 | "u_div": {
125 | "body": [
126 | "",
127 | "\t$1",
128 | "
"
129 | ],
130 | "triggerAssist": false,
131 | "prefix": "u_div"
132 | },
133 | "u_image": {
134 | "body": [
135 | ""
136 | ],
137 | "triggerAssist": false,
138 | "prefix": "u_image"
139 | },
140 | "u_input": {
141 | "body": [
142 | ""
143 | ],
144 | "triggerAssist": false,
145 | "prefix": "u_input"
146 | },
147 | "u_label": {
148 | "body": [
149 | "",
150 | "",
151 | ""
152 | ],
153 | "triggerAssist": false,
154 | "prefix": "u_label"
155 | },
156 | "u_picker": {
157 | "body": [
158 | ""
159 | ],
160 | "triggerAssist": false,
161 | "prefix": "u_picker"
162 | },
163 | "u_progress": {
164 | "body": [
165 | ""
166 | ],
167 | "triggerAssist": false,
168 | "prefix": "u_progress"
169 | },
170 | "u_refresh": {
171 | "body": [
172 | "",
173 | "\t$1",
174 | "\t\t{{componentName}}",
175 | "\t
",
176 | "\t",
177 | "\t\t",
178 | "\t
",
179 | ""
180 | ],
181 | "triggerAssist": false,
182 | "prefix": "u_refresh"
183 | },
184 | "u_slider": {
185 | "body": [
186 | ""
187 | ],
188 | "triggerAssist": false,
189 | "prefix": "u_slider"
190 | },
191 | "u_a": {
192 | "body": [
193 | ""
194 | ],
195 | "triggerAssist": false,
196 | "prefix": "u_a"
197 | },
198 | "u_stack": {
199 | "body": [
200 | "",
201 | "\t$1",
202 | ""
203 | ],
204 | "triggerAssist": false,
205 | "prefix": "u_stack"
206 | },
207 | "u_swiper": {
208 | "body": [
209 | "",
210 | "\tA",
211 | "\tB",
212 | "\tC",
213 | ""
214 | ],
215 | "triggerAssist": false,
216 | "prefix": "u_swiper"
217 | },
218 | "u_switch": {
219 | "body": [
220 | ""
221 | ],
222 | "triggerAssist": false,
223 | "prefix": "u_switch"
224 | },
225 | "u_text": {
226 | "body": [
227 | "$1"
228 | ],
229 | "triggerAssist": false,
230 | "prefix": "u_text"
231 | },
232 | "u_textarea": {
233 | "body": [
234 | ""
235 | ],
236 | "triggerAssist": false,
237 | "prefix": "u_textarea"
238 | },
239 | "u_video": {
240 | "body": [
241 | ""
242 | ],
243 | "triggerAssist": false,
244 | "prefix": "u_video"
245 | },
246 | "u_web": {
247 | "body": [
248 | ""
249 | ],
250 | "triggerAssist": false,
251 | "prefix": "u_web"
252 | },
253 | "u_import": {
254 | "body": [
255 | ""
256 | ],
257 | "triggerAssist": false,
258 | "prefix": "u_import"
259 | },
260 | "u_block": {
261 | "body": [
262 | "",
263 | "\t{{\\$item.name}}",
264 | ""
265 | ],
266 | "triggerAssist": false,
267 | "prefix": "u_block"
268 | }
269 | }
--------------------------------------------------------------------------------
/html.md:
--------------------------------------------------------------------------------
1 | |API|Prefix|Description|
2 | |-|-|-|
3 | |`APP-PLUS`|`platform-app,platform-app-plus,app,app-plus`|APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
4 | |`APP-NVUE`|`platform-app-nvue,platform-app-plus-nvue,app-nvue,app-plus-nvue`|APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
5 | |`H5`|`platform-h5,h5`|H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
6 | |`MP-WEIXIN`|`platform-mp-weixin,platform-weixin,platform-mp-wechat,platform-wechat,mp-weixin,weixin,mp-wechat,wechat`|微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
7 | |`MP-ALIPAY`|`platform-mp-alipay,platform-alipay,platform-mp-ali,platform-ali,mp-alipay,alipay,mp-ali,ali`|支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
8 | |`MP-BAIDU`|`platform-mp-baidu,platform-baidu,mp-baidu,baidu`|百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
9 | |`MP-TOUTIAO`|`platform-mp-toutiao,platform-toutiao,platform-mp-bytedance,platform-bytedance,mp-toutiao,toutiao,mp-bytedance,bytedance`|字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
10 | |`MP-QQ`|`platform-mp-qq,platform-qq,mp-qq,qq`|QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
11 | |`MP-360`|`platform-mp-360,platform-360,mp-360,360`|360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
12 | |`MP`|`platform-mp,mp`|小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
13 | |`QUICKAPP-WEBVIEW`|`platform-quickapp,platform-quickapp-webview,quickapp,quickapp-webview`|快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
14 | |`QUICKAPP-WEBVIEW-UNION`|`platform-quickapp-union,platform-quickapp-webview-union,quickapp-union,quickapp-webview-union`|快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
15 | |`QUICKAPP-WEBVIEW-HUAWEI`|`platform-quickapp-huawei,platform-quickapp-webview-huawei,quickapp-huawei,quickapp-webview-huawei`|快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/platform。|
16 | |`,$2,`|`#ifdef,ifdef`|条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/platform。|
17 | |`,$2,`|`#ifndef,ifndef`|条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/platform。|
18 | |``|`#endif,endif`|结束条件编译。更多信息查看 https://uniapp.dcloud.io/platform。|
19 | |`$1$0`|`view,`|视图容器,用于包裹各种元素内容。更多信息查看 https://uniapp.dcloud.io/component/view。|
20 | |`, $2,$0`|`scroll-view,`|可滚动视图区域。竖向滚动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/scroll-view。|
21 | |`, $1,$0`|`swiper,`|滑块视图容器。子组件只能是 swiper-item。竖向滑动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper。|
22 | |`$1$0`|`swiper-item,`|只能是 swiper 的子组件,宽高自动设置为 100%。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper-item。|
23 | |`$2$0`|`match-media,`|可适配不同屏幕的基本视图组件。更多信息查看 https://uniapp.dcloud.io/component/match-media。|
24 | |`, , $7, ,$0`|`movable-area,`|可拖动区域组件,指代可拖动的范围。子组件只能是 movable-view。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-area。|
25 | |`, $6,$0`|`movable-view,`|可移动的视图容器。只能是 movable-area 的子组件。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-view。|
26 | |`$1$0`|`cover-view,`|覆盖在原生组件上的文本视图。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-view。|
27 | |`$0`|`cover-image,`|覆盖在原生组件上的图片视图。可以嵌套在 cover-view 里。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-image。|
28 | |`$0`|`icon,`|图标。更多信息查看 https://uniapp.dcloud.io/component/icon。|
29 | |`$1$0`|`text,`|文本组件。用于包裹文本内容。更多信息查看 https://uniapp.dcloud.io/component/text。|
30 | |`$0`|`rich-text,`|富文本。更多信息查看 https://uniapp.dcloud.io/component/rich-text。|
31 | |`$0`|`progress,