├── .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 | "", 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 | "" 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}\">" 36 | ], 37 | "description": "component element with props" 38 | }, 39 | "Vue Image Source Binding": { 40 | "prefix": "vsrc", 41 | "body": [ 42 | "\"${2:altText}\"/" 43 | ], 44 | "description": "image source binding" 45 | }, 46 | "Vue Style Binding": { 47 | "prefix": "vstyle", 48 | "body": [ 49 | "<${1:div} :style=\"{ fontSize: ${2:data} + 'px' }\">" 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]}\">" 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} }\">" 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}]\">" 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}}]\">" 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 | "" 9 | ], 10 | "triggerAssist": false, 11 | "prefix": "q_template" 12 | }, 13 | "q_template_root": { 14 | "body": [ 15 | "", 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\t
tabContent1$1
", 67 | "\t\t
tabContent2
", 68 | "\t\t
tabContent3
", 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 | "" 9 | ], 10 | "triggerAssist": false, 11 | "prefix": "u_template" 12 | }, 13 | "u_template_root": { 14 | "body": [ 15 | "", 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\t
tabContent1$1
", 67 | "\t\t
tabContent2
", 68 | "\t\t
tabContent3
", 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,`|进度条。更多信息查看 https://uniapp.dcloud.io/component/progress。| 32 | |`, $5,$0`|`button,, ,$0`|`form,
`|表单,将组件内的用户输入的 switch input checkbox slider radio picker 提交。更多信息查看 https://uniapp.dcloud.io/component/form。| 37 | |`$0`|`input,`|输入框。更多信息查看 https://uniapp.dcloud.io/component/input。| 38 | |`$0`|`label,下载视频", 596 | "" 597 | ], 598 | "triggerAssist": false, 599 | "prefix": "video" 600 | }, 601 | "h3": { 602 | "body": [ 603 | "

$0

" 604 | ], 605 | "triggerAssist": false, 606 | "prefix": "h3" 607 | }, 608 | "h2": { 609 | "body": [ 610 | "

$0

" 611 | ], 612 | "triggerAssist": false, 613 | "prefix": "h2" 614 | }, 615 | "data-": { 616 | "body": [ 617 | "data-${1:type} = \"$2\"" 618 | ], 619 | "triggerAssist": false, 620 | "scope": "HTML_ATTRIBUTE", 621 | "prefix": "data-" 622 | }, 623 | "input_submit": { 624 | "body": [ 625 | "" 626 | ], 627 | "triggerAssist": false, 628 | "prefix": "insubmit" 629 | }, 630 | "ng-pluralize": { 631 | "body": [ 632 | "$1" 633 | ], 634 | "triggerAssist": false, 635 | "prefix": "ngp" 636 | }, 637 | "canvas": { 638 | "body": [ 639 | "" 640 | ], 641 | "triggerAssist": false, 642 | "prefix": "canvas" 643 | }, 644 | "table": { 645 | "body": [ 646 | "", 647 | "\t", 648 | "\t", 649 | "
${4:Header}
${5:Data}
" 650 | ], 651 | "triggerAssist": false, 652 | "prefix": "table" 653 | }, 654 | "" 659 | ], 660 | "triggerAssist": false, 661 | "prefix": "ifie" 662 | }, 663 | "input_search": { 664 | "body": [ 665 | "" 666 | ], 667 | "triggerAssist": false, 668 | "prefix": "insearch" 669 | }, 670 | "img_src": { 671 | "body": [ 672 | "" 673 | ], 674 | "triggerAssist": true, 675 | "prefix": "img" 676 | }, 677 | "input": { 678 | "body": [ 679 | "" 680 | ], 681 | "triggerAssist": true, 682 | "prefix": "input" 683 | }, 684 | "iframe": { 685 | "body": [ 686 | "" 687 | ], 688 | "triggerAssist": true, 689 | "prefix": "iframe" 690 | }, 691 | "html_5": { 692 | "body": [ 693 | "" 694 | ], 695 | "triggerAssist": false, 696 | "prefix": "dochtml5" 697 | }, 698 | "form_submit": { 699 | "body": [ 700 | "", 701 | "\t$0", 702 | "\t", 703 | "
" 704 | ], 705 | "triggerAssist": true, 706 | "prefix": "form" 707 | }, 708 | "select_option": { 709 | "body": [ 710 | "" 713 | ], 714 | "triggerAssist": false, 715 | "prefix": "select" 716 | }, 717 | "ng-": { 718 | "body": [ 719 | "ng-${1:app}=\"$2\"" 720 | ], 721 | "triggerAssist": false, 722 | "scope": "HTML_ATTRIBUTE", 723 | "prefix": "ng-" 724 | }, 725 | "link": { 726 | "body": [ 727 | "" 728 | ], 729 | "triggerAssist": true, 730 | "prefix": "link" 731 | }, 732 | "div": { 733 | "body": [ 734 | "
", 735 | "\t$0", 736 | "
" 737 | ], 738 | "triggerAssist": true, 739 | "prefix": "div" 740 | }, 741 | "input_text": { 742 | "body": [ 743 | "" 744 | ], 745 | "triggerAssist": true, 746 | "prefix": "intext" 747 | }, 748 | "meta": { 749 | "body": [ 750 | "" 751 | ], 752 | "triggerAssist": true, 753 | "prefix": "meta" 754 | }, 755 | "dl_dt_dd": { 756 | "body": [ 757 | "
", 758 | "\t
$1
", 759 | "\t
$2
", 760 | "
" 761 | ], 762 | "triggerAssist": false, 763 | "prefix": "dl" 764 | }, 765 | "style": { 766 | "body": [ 767 | "" 770 | ], 771 | "triggerAssist": false, 772 | "prefix": "style" 773 | }, 774 | "fieldset": { 775 | "body": [ 776 | "
", 777 | "\t$1", 778 | "\t", 779 | "\t$0", 780 | "
" 781 | ], 782 | "triggerAssist": false, 783 | "prefix": "fieldset" 784 | }, 785 | "meta_viewport": { 786 | "body": [ 787 | "" 788 | ], 789 | "triggerAssist": false, 790 | "prefix": "metaviewport" 791 | }, 792 | "meta_UTF8": { 793 | "body": [ 794 | "" 795 | ], 796 | "triggerAssist": false, 797 | "prefix": "metautf" 798 | }, 799 | "meta_GB2312": { 800 | "body": [ 801 | "" 802 | ], 803 | "triggerAssist": false, 804 | "prefix": "metagb" 805 | }, 806 | "input_reset": { 807 | "body": [ 808 | "" 809 | ], 810 | "triggerAssist": false, 811 | "prefix": "inreset" 812 | }, 813 | "input_password": { 814 | "body": [ 815 | "" 816 | ], 817 | "triggerAssist": false, 818 | "prefix": "inpassword" 819 | }, 820 | "input_image": { 821 | "body": [ 822 | "" 823 | ], 824 | "triggerAssist": true, 825 | "prefix": "inimage" 826 | }, 827 | "" 832 | ], 833 | "triggerAssist": false, 834 | "prefix": "ifie6" 835 | }, 836 | "Non-Breaking Space": { 837 | "body": [ 838 | "\u0026nbsp;" 839 | ], 840 | "triggerAssist": false, 841 | "prefix": "space" 842 | }, 843 | "meta_description": { 844 | "body": [ 845 | "" 846 | ], 847 | "triggerAssist": false, 848 | "prefix": "metadescription" 849 | }, 850 | "span_id": { 851 | "body": [ 852 | "", 853 | "\t$0", 854 | "" 855 | ], 856 | "triggerAssist": true, 857 | "prefix": "span" 858 | }, 859 | "input_lable": { 860 | "body": [ 861 | "" 862 | ], 863 | "triggerAssist": false, 864 | "prefix": "inputlable" 865 | } 866 | } -------------------------------------------------------------------------------- /snippets/mui.json: -------------------------------------------------------------------------------- 1 | { 2 | "mui().each()": { 3 | "body": [ 4 | "mui(\u0027$1\u0027).each(function (${3:index},${4:element}) {", 5 | "\t$0", 6 | "})" 7 | ], 8 | "triggerAssist": false, 9 | "scope": "source.js", 10 | "prefix": "mmeach" 11 | }, 12 | "plus.camera": { 13 | "body": [ 14 | "plus.camera." 15 | ], 16 | "triggerAssist": true, 17 | "scope": "source.js", 18 | "prefix": "pcamera" 19 | }, 20 | "plus.contacts": { 21 | "body": [ 22 | "plus.contacts." 23 | ], 24 | "triggerAssist": true, 25 | "scope": "source.js", 26 | "prefix": "pcontacts" 27 | }, 28 | "mui.confirm()": { 29 | "body": [ 30 | "mui.confirm(\u0027${1:message}\u0027,\u0027${2:title}\u0027,[\u0027${3:取消}\u0027,\u0027${4:确认}\u0027],function (${5:e}) {", 31 | "\t${5:e}.index$0", 32 | "}${6:,\u0027div\u0027})" 33 | ], 34 | "triggerAssist": false, 35 | "scope": "source.js", 36 | "prefix": "mdconfirm" 37 | }, 38 | "plus.statistic": { 39 | "body": [ 40 | "plus.statistic." 41 | ], 42 | "triggerAssist": true, 43 | "scope": "source.js", 44 | "prefix": "pstatistic" 45 | }, 46 | "plus.key": { 47 | "body": [ 48 | "plus.key." 49 | ], 50 | "triggerAssist": true, 51 | "scope": "source.js", 52 | "prefix": "pkey" 53 | }, 54 | "plus.storage": { 55 | "body": [ 56 | "plus.storage." 57 | ], 58 | "triggerAssist": true, 59 | "scope": "source.js", 60 | "prefix": "pstorage" 61 | }, 62 | "plus.payment": { 63 | "body": [ 64 | "plus.payment." 65 | ], 66 | "triggerAssist": true, 67 | "scope": "source.js", 68 | "prefix": "ppayment" 69 | }, 70 | "mui.getJSON()": { 71 | "body": [ 72 | "mui.getJSON(\u0027$1\u0027,{$2},function($3){", 73 | "\t\t$4", 74 | "\t}", 75 | ");$0" 76 | ], 77 | "triggerAssist": true, 78 | "scope": "source.js", 79 | "prefix": "mjson" 80 | }, 81 | "plus.net": { 82 | "body": [ 83 | "plus.net." 84 | ], 85 | "triggerAssist": true, 86 | "scope": "source.js", 87 | "prefix": "pnet" 88 | }, 89 | "plus.runtime": { 90 | "body": [ 91 | "plus.runtime." 92 | ], 93 | "triggerAssist": true, 94 | "scope": "source.js", 95 | "prefix": "pruntime" 96 | }, 97 | "mui.scrollTo()": { 98 | "body": [ 99 | "mui.scrollTo(${1:ypos},${2:duration},${3:/function () {", 100 | " \t", 101 | "}}$0" 102 | ], 103 | "triggerAssist": false, 104 | "scope": "source.js", 105 | "prefix": "mscrollto" 106 | }, 107 | "plus.uploader": { 108 | "body": [ 109 | "plus.uploader." 110 | ], 111 | "triggerAssist": true, 112 | "scope": "source.js", 113 | "prefix": "puploader" 114 | }, 115 | "mui.backTask(双击进入后台)": { 116 | "body": [ 117 | "//首页返回键处理", 118 | "//处理逻辑:1秒内,连续两次按返回键,则进入后台;", 119 | "var first \u003d null;", 120 | "mui.back \u003d function() {", 121 | "\t//首次按键,提示‘再按一次退出应用’", 122 | "\tif (!first) {", 123 | "\t\tfirst \u003d new Date().getTime();", 124 | "\t\tmui.toast(\u0027再按一次退出应用\u0027);", 125 | "\t\tsetTimeout(function() {", 126 | "\t\t\tfirst \u003d null;", 127 | "\t\t}, 1000);", 128 | "\t} else {", 129 | "\t\tif (new Date().getTime() - first \u003c 1000) {", 130 | "\t\t\tvar main \u003d plus.android.runtimeMainActivity();", 131 | " main.moveTaskToBack(false);", 132 | "\t\t}", 133 | "\t}", 134 | "};" 135 | ], 136 | "triggerAssist": false, 137 | "scope": "source.js", 138 | "prefix": "mbackMoveTaskToBack" 139 | }, 140 | "mui.plusReady()": { 141 | "body": [ 142 | "mui.plusReady(function () {", 143 | " $1", 144 | "})$0" 145 | ], 146 | "triggerAssist": false, 147 | "scope": "source.js", 148 | "prefix": "mplusready" 149 | }, 150 | "plus.io": { 151 | "body": [ 152 | "plus.io." 153 | ], 154 | "triggerAssist": true, 155 | "scope": "source.js", 156 | "prefix": "pio" 157 | }, 158 | "querySelector": { 159 | "body": [ 160 | "document.querySelector(\u0027$1\u0027).$0" 161 | ], 162 | "triggerAssist": true, 163 | "scope": "source.js", 164 | "prefix": "ds" 165 | }, 166 | "mui.init({刷新组件})": { 167 | "body": [ 168 | "mui.init({", 169 | " pullRefresh : {", 170 | " container:\u0027#${1:refreshContainer}\u0027,", 171 | " down : {", 172 | " callback :${2:pullfresh}", 173 | " },", 174 | " up : {", 175 | " callback :${3:pullfresh} ", 176 | " }", 177 | " }", 178 | "});$0" 179 | ], 180 | "triggerAssist": true, 181 | "scope": "source.js", 182 | "prefix": "minpullRefresh" 183 | }, 184 | "mui.init({按键绑定})": { 185 | "body": [ 186 | "mui.init({", 187 | "\tkeyEventBind: {", 188 | "\t\tbackbutton: ${1:true/false}, ", 189 | "\t\tmenubutton: ${2:true/false} ", 190 | "\t},", 191 | "})" 192 | ], 193 | "triggerAssist": false, 194 | "scope": "source.js", 195 | "prefix": "minkeyevent" 196 | }, 197 | "mui(\u0027\u0027).slider": { 198 | "body": [ 199 | "mui(\u0027.${1:mui-slider}\u0027).slider({$2})$0" 200 | ], 201 | "triggerAssist": true, 202 | "scope": "source.js", 203 | "prefix": "mmslider" 204 | }, 205 | "mui.backDouble(双击退出应用)": { 206 | "body": [ 207 | "//首页返回键处理", 208 | "//处理逻辑:1秒内,连续两次按返回键,则退出应用;", 209 | "var first \u003d null;", 210 | "mui.back \u003d function() {", 211 | "\t//首次按键,提示‘再按一次退出应用’", 212 | "\tif (!first) {", 213 | "\t\tfirst \u003d new Date().getTime();", 214 | "\t\tmui.toast(\u0027再按一次退出应用\u0027);", 215 | "\t\tsetTimeout(function() {", 216 | "\t\t\tfirst \u003d null;", 217 | "\t\t}, 1000);", 218 | "\t} else {", 219 | "\t\tif (new Date().getTime() - first \u003c 1000) {", 220 | "\t\t\tplus.runtime.quit();", 221 | "\t\t}", 222 | "\t}", 223 | "};" 224 | ], 225 | "triggerAssist": false, 226 | "scope": "source.js", 227 | "prefix": "mbackDouble" 228 | }, 229 | "mui(\u0027\u0027).scroll": { 230 | "body": [ 231 | "mui(\u0027.${1:mui-scroll-wrapper}\u0027).scroll({$2})$0" 232 | ], 233 | "triggerAssist": true, 234 | "scope": "source.js", 235 | "prefix": "mmscroll" 236 | }, 237 | "mui.preload()": { 238 | "body": [ 239 | "mui.preload({", 240 | "\turl:\u0027${1:url}\u0027,", 241 | "\tid:\u0027${2:id}\u0027,", 242 | "\tstyles:{$3},//窗口参数", 243 | "\textras:{$4}//自定义扩展参数", 244 | "})$0" 245 | ], 246 | "triggerAssist": true, 247 | "scope": "source.js", 248 | "prefix": "mpreload" 249 | }, 250 | "mui.open": { 251 | "body": [ 252 | "mui.openWindow(\u0027${1:url}\u0027,\u0027${2:id}\u0027,{$3})" 253 | ], 254 | "triggerAssist": true, 255 | "scope": "source.js", 256 | "prefix": "mopen" 257 | }, 258 | "plus.push": { 259 | "body": [ 260 | "plus.push." 261 | ], 262 | "triggerAssist": true, 263 | "scope": "source.js", 264 | "prefix": "ppush" 265 | }, 266 | "plus.gallery": { 267 | "body": [ 268 | "plus.gallery." 269 | ], 270 | "triggerAssist": true, 271 | "scope": "source.js", 272 | "prefix": "pgallery" 273 | }, 274 | "return false;": { 275 | "body": [ 276 | "return false;" 277 | ], 278 | "triggerAssist": false, 279 | "scope": "source.js", 280 | "prefix": "rfalse" 281 | }, 282 | "mui.init({重写窗口关闭逻辑})": { 283 | "body": [ 284 | "mui.init({", 285 | "\tbeforeback:function () {", 286 | "\t\t$0", 287 | "\t}", 288 | "})" 289 | ], 290 | "triggerAssist": false, 291 | "scope": "source.js", 292 | "prefix": "minbeforeback" 293 | }, 294 | "mui.init({预加载数量})": { 295 | "body": [ 296 | "preloadLimit:${1:5}" 297 | ], 298 | "triggerAssist": true, 299 | "scope": "source.js", 300 | "prefix": "minprelimit" 301 | }, 302 | "mui.back()(返回上级页面)": { 303 | "body": [ 304 | "mui.back()$0" 305 | ], 306 | "triggerAssist": false, 307 | "scope": "source.js", 308 | "prefix": "mback" 309 | }, 310 | "querySelectoraddEventListener": { 311 | "body": [ 312 | "document.querySelector(\u0027$1\u0027).addEventListener(\u0027${2:tap}\u0027,function ($3) {", 313 | " $0", 314 | "})" 315 | ], 316 | "triggerAssist": true, 317 | "scope": "source.js", 318 | "prefix": "dsa" 319 | }, 320 | "documentaddEventListener": { 321 | "body": [ 322 | "document.addEventListener(\u0027${1:scroll}\u0027,function ($2) {", 323 | " $0", 324 | "})" 325 | ], 326 | "triggerAssist": true, 327 | "scope": "source.js", 328 | "prefix": "dad" 329 | }, 330 | "mui.fire()": { 331 | "body": [ 332 | "mui.fire(${1:targetWebviewObj},\u0027${2:event}\u0027,{${3:data}})" 333 | ], 334 | "triggerAssist": true, 335 | "scope": "source.js", 336 | "prefix": "mfire" 337 | }, 338 | "plus.messaging": { 339 | "body": [ 340 | "plus.messaging." 341 | ], 342 | "triggerAssist": true, 343 | "scope": "source.js", 344 | "prefix": "pmessaging" 345 | }, 346 | "mui.alert()": { 347 | "body": [ 348 | "mui.alert(\u0027${1:message}\u0027,\u0027${2:title}\u0027,\u0027${3:btnValue}\u0027,function (${4:e}) {", 349 | " ${4:e}.index$0", 350 | "}${5:,\u0027div\u0027})" 351 | ], 352 | "triggerAssist": false, 353 | "scope": "source.js", 354 | "prefix": "mdalert" 355 | }, 356 | "mui.ajax()": { 357 | "body": [ 358 | "mui.ajax(\u0027$1\u0027,{", 359 | "\tdata:{", 360 | "\t\t$2", 361 | "\t},", 362 | "\tdataType:\u0027${3:json}\u0027,//服务器返回json格式数据", 363 | "\ttype:\u0027${4:post}\u0027,//HTTP请求类型", 364 | "\ttimeout:${5:10000},//超时时间设置为10秒;", 365 | "\tsuccess:function(${6:data}){", 366 | "\t\t$7", 367 | "\t},", 368 | "\terror:function(${8:xhr,type,errorThrown}){", 369 | "\t\t$9", 370 | "\t}", 371 | "});$0" 372 | ], 373 | "triggerAssist": true, 374 | "scope": "source.js", 375 | "prefix": "majax" 376 | }, 377 | "plus.networkinfo": { 378 | "body": [ 379 | "plus.networkinfo." 380 | ], 381 | "triggerAssist": true, 382 | "scope": "source.js", 383 | "prefix": "pnetworkinfo" 384 | }, 385 | "mui.off": { 386 | "body": [ 387 | "mui(\u0027$1\u0027).off(\u0027${2:tap}\u0027,\u0027$3\u0027,function($4){", 388 | " $0", 389 | "}) " 390 | ], 391 | "triggerAssist": true, 392 | "scope": "source.js", 393 | "prefix": "mmoff" 394 | }, 395 | "plus.device": { 396 | "body": [ 397 | "plus.device." 398 | ], 399 | "triggerAssist": true, 400 | "scope": "source.js", 401 | "prefix": "pdevice" 402 | }, 403 | "mui(\u0027\u0027).pullRefresh": { 404 | "body": [ 405 | "mui(\u0027#${1:refreshContainer}\u0027).pullRefresh().$2" 406 | ], 407 | "triggerAssist": true, 408 | "scope": "source.js", 409 | "prefix": "mmpullrefresh" 410 | }, 411 | "plus.nativeUI": { 412 | "body": [ 413 | "plus.nativeUI." 414 | ], 415 | "triggerAssist": true, 416 | "scope": "source.js", 417 | "prefix": "pnativeUI" 418 | }, 419 | "plus.android": { 420 | "body": [ 421 | "plus.android." 422 | ], 423 | "triggerAssist": true, 424 | "scope": "source.js", 425 | "prefix": "pandroid" 426 | }, 427 | "plus.share": { 428 | "body": [ 429 | "plus.share." 430 | ], 431 | "triggerAssist": true, 432 | "scope": "source.js", 433 | "prefix": "pshare" 434 | }, 435 | "mui.init({手势事件})": { 436 | "body": [ 437 | "mui.init({", 438 | " \tgestureConfig:{", 439 | "\t tap: ${1:true/false}, ", 440 | "\t doubletap: ${2:true/false}, ", 441 | "\t longtap: ${3:true/false}, ", 442 | "\t swipe: ${4:true/false}, ", 443 | "\t drag: ${5:true/false}, ", 444 | "\t hold:${6:false/true},", 445 | "\t release:${7:false/true}", 446 | " \t}", 447 | "});$0" 448 | ], 449 | "triggerAssist": false, 450 | "scope": "source.js", 451 | "prefix": "mingesture" 452 | }, 453 | "plus.ios": { 454 | "body": [ 455 | "plus.ios." 456 | ], 457 | "triggerAssist": true, 458 | "scope": "source.js", 459 | "prefix": "pios" 460 | }, 461 | "plus.speech": { 462 | "body": [ 463 | "plus.speech.$0" 464 | ], 465 | "triggerAssist": true, 466 | "scope": "source.js", 467 | "prefix": "pspeech" 468 | }, 469 | "plus.display": { 470 | "body": [ 471 | "plus.display." 472 | ], 473 | "triggerAssist": true, 474 | "scope": "source.js", 475 | "prefix": "pdisplay" 476 | }, 477 | "mui.get()": { 478 | "body": [ 479 | "mui.get(\u0027$1\u0027,{", 480 | "\t\t$2", 481 | "\t},function(${3:data}){", 482 | "\t\t$0", 483 | "\t},\u0027${4:json}\u0027", 484 | ");" 485 | ], 486 | "triggerAssist": true, 487 | "scope": "source.js", 488 | "prefix": "mget" 489 | }, 490 | "mui.init({预加载})": { 491 | "body": [ 492 | "mui.init({", 493 | "\tpreloadPages:[{", 494 | "\t url:\u0027${1:url}\u0027,", 495 | " id:\u0027${2:id}\u0027,", 496 | " styles:{", 497 | " $3", 498 | " },", 499 | " extras:{$4}", 500 | "\t}]", 501 | "})$0" 502 | ], 503 | "triggerAssist": true, 504 | "scope": "source.js", 505 | "prefix": "minpreload" 506 | }, 507 | "plus.nativeObj": { 508 | "body": [ 509 | "plus.nativeObj." 510 | ], 511 | "triggerAssist": true, 512 | "scope": "source.js", 513 | "prefix": "pnativeObj" 514 | }, 515 | "mui.post()": { 516 | "body": [ 517 | "mui.post(\u0027$1\u0027,{", 518 | "\t\t$2", 519 | "\t},function(${3:data}){", 520 | "\t\t$0", 521 | "\t},\u0027${4:json}\u0027", 522 | ");" 523 | ], 524 | "triggerAssist": true, 525 | "scope": "source.js", 526 | "prefix": "mpost" 527 | }, 528 | "mui.closePopup()": { 529 | "body": [ 530 | "mui.closePopup()$0" 531 | ], 532 | "triggerAssist": false, 533 | "scope": "source.js", 534 | "prefix": "mdclosePopup" 535 | }, 536 | "plus.navigator": { 537 | "body": [ 538 | "plus.navigatorsc." 539 | ], 540 | "triggerAssist": true, 541 | "scope": "source.js", 542 | "prefix": "pnavigator" 543 | }, 544 | "mui.trigger()": { 545 | "body": [ 546 | "mui.trigger(${1:dom},\u0027${3:tap}\u0027${4:,{a:\u0027as\u0027}})" 547 | ], 548 | "triggerAssist": false, 549 | "scope": "source.js", 550 | "prefix": "mtrigger" 551 | }, 552 | "plus.downloader": { 553 | "body": [ 554 | "plus.downloader." 555 | ], 556 | "triggerAssist": true, 557 | "scope": "source.js", 558 | "prefix": "pdown" 559 | }, 560 | "plusReady": { 561 | "body": [ 562 | "function plusReady(){", 563 | " $0", 564 | "}", 565 | "if (window.plus) {", 566 | " plusReady()", 567 | "} else{", 568 | " document.addEventListener(\u0027plusready\u0027,plusReady,false);", 569 | "}" 570 | ], 571 | "triggerAssist": true, 572 | "scope": "source.js", 573 | "prefix": "pready" 574 | }, 575 | "mui.backFunction(重写返回逻辑)": { 576 | "body": [ 577 | "mui.back\u003dfunction () {", 578 | " $0\t", 579 | "}" 580 | ], 581 | "triggerAssist": false, 582 | "scope": "source.js", 583 | "prefix": "mbackfunction" 584 | }, 585 | "mui.mask": { 586 | "body": [ 587 | "var ${1:mask} \u003d mui.createMask(function () {", 588 | "\t$2", 589 | "})", 590 | "${1:mask}.show()" 591 | ], 592 | "triggerAssist": false, 593 | "scope": "source.js", 594 | "prefix": "mmask" 595 | }, 596 | "plus.geolocation": { 597 | "body": [ 598 | "plus.geolocation." 599 | ], 600 | "triggerAssist": true, 601 | "scope": "source.js", 602 | "prefix": "pgeolocation" 603 | }, 604 | "mui.init({设置状态栏颜色})": { 605 | "body": [ 606 | "mui.init({", 607 | "\tstatusBarBackground:\u0027#${1:FFFFFF}\u0027", 608 | "})" 609 | ], 610 | "triggerAssist": true, 611 | "scope": "source.js", 612 | "prefix": "minstatusbar" 613 | }, 614 | "plus.oauth": { 615 | "body": [ 616 | "plus.oauth." 617 | ], 618 | "triggerAssist": true, 619 | "scope": "source.js", 620 | "prefix": "poauth" 621 | }, 622 | "mui.prompt()": { 623 | "body": [ 624 | " mui.prompt(\u0027${1:text}\u0027,\u0027${2:defaultText}\u0027,\u0027${3:title}\u0027,[\u0027${4:取消}\u0027,\u0027${5:确认}\u0027],function (${6:e}) {", 625 | " ${6:e}.index$0", 626 | "}${7:,\u0027div\u0027})" 627 | ], 628 | "triggerAssist": false, 629 | "scope": "source.js", 630 | "prefix": "mdprompt" 631 | }, 632 | "plus.zip": { 633 | "body": [ 634 | "plus.zip." 635 | ], 636 | "triggerAssist": true, 637 | "scope": "source.js", 638 | "prefix": "pzip" 639 | }, 640 | "mui.ready": { 641 | "body": [ 642 | "mui.ready(function () {", 643 | "\t$0", 644 | "})" 645 | ], 646 | "triggerAssist": false, 647 | "scope": "source.js", 648 | "prefix": "mready" 649 | }, 650 | "mui.init": { 651 | "body": [ 652 | "mui.init({$0})" 653 | ], 654 | "triggerAssist": false, 655 | "scope": "source.js", 656 | "prefix": "minit" 657 | }, 658 | "plus.audio": { 659 | "body": [ 660 | "plus.audio." 661 | ], 662 | "triggerAssist": true, 663 | "scope": "source.js", 664 | "prefix": "paudio" 665 | }, 666 | "console.log();": { 667 | "body": [ 668 | "console.log($1);" 669 | ], 670 | "triggerAssist": false, 671 | "scope": "source.js", 672 | "prefix": "clog" 673 | }, 674 | "plus.proximity": { 675 | "body": [ 676 | "plus.proximity." 677 | ], 678 | "triggerAssist": true, 679 | "scope": "source.js", 680 | "prefix": "pproximity" 681 | }, 682 | "plus.orientation": { 683 | "body": [ 684 | "plus.orientation." 685 | ], 686 | "triggerAssist": true, 687 | "scope": "source.js", 688 | "prefix": "porientation" 689 | }, 690 | "mui.init({子页面})": { 691 | "body": [ 692 | "mui.init({", 693 | "\tsubpages:[{", 694 | "\t url:\u0027${1:url}\u0027,", 695 | " id:\u0027${2:id}\u0027,", 696 | " styles:{", 697 | " $3", 698 | " },", 699 | " extras:{$4}", 700 | "\t}]", 701 | "})$0" 702 | ], 703 | "triggerAssist": true, 704 | "scope": "source.js", 705 | "prefix": "minsubpage" 706 | }, 707 | "plus.os": { 708 | "body": [ 709 | "plus.os." 710 | ], 711 | "triggerAssist": true, 712 | "scope": "source.js", 713 | "prefix": "pos" 714 | }, 715 | "mui.later()": { 716 | "body": [ 717 | "mui.later(function(){", 718 | "\t$2 ", 719 | "},${1:500/1000/1500/2000})" 720 | ], 721 | "triggerAssist": false, 722 | "scope": "source.js", 723 | "prefix": "mlater" 724 | }, 725 | "mui.extend()": { 726 | "body": [ 727 | "mui.extend(${1:\u0027target\u0027},${2:\u0027source\u0027},${3:\u0027deep\u0027/true/false})" 728 | ], 729 | "triggerAssist": false, 730 | "scope": "source.js", 731 | "prefix": "mextend" 732 | }, 733 | "mui": { 734 | "body": [ 735 | "mui." 736 | ], 737 | "triggerAssist": true, 738 | "scope": "source.js", 739 | "prefix": "mui" 740 | }, 741 | "mui.os": { 742 | "body": [ 743 | "mui.os." 744 | ], 745 | "triggerAssist": true, 746 | "scope": "source.js", 747 | "prefix": "mos" 748 | }, 749 | "plus.accelerometer": { 750 | "body": [ 751 | "plus.accelerometer." 752 | ], 753 | "triggerAssist": true, 754 | "scope": "source.js", 755 | "prefix": "pacce" 756 | }, 757 | "mui.init({侧滑返回})": { 758 | "body": [ 759 | "mui.init({", 760 | "\tswipeBack:${1:true/false} ", 761 | ");$0" 762 | ], 763 | "triggerAssist": false, 764 | "scope": "source.js", 765 | "prefix": "minswipeback" 766 | }, 767 | "clogios": { 768 | "body": [ 769 | "console.log(JSON.stringify(${1:e}));", 770 | "console.log(\u0027${2:e}\u0027);" 771 | ], 772 | "triggerAssist": true, 773 | "scope": "source.js", 774 | "prefix": "cloios" 775 | }, 776 | "mui.toast()": { 777 | "body": [ 778 | "mui.toast(\u0027${1:message}\u0027)$0" 779 | ], 780 | "triggerAssist": false, 781 | "scope": "source.js", 782 | "prefix": "mdtoast" 783 | }, 784 | "return true;": { 785 | "body": [ 786 | "return true;" 787 | ], 788 | "triggerAssist": false, 789 | "scope": "source.js", 790 | "prefix": "rtrue" 791 | }, 792 | "mui.on": { 793 | "body": [ 794 | "mui(\u0027$1\u0027).on(\u0027${2:tap}\u0027,\u0027$3\u0027,function($4){", 795 | " $0", 796 | "}) " 797 | ], 798 | "triggerAssist": true, 799 | "scope": "source.js", 800 | "prefix": "mmon" 801 | }, 802 | "mui()": { 803 | "body": [ 804 | "mui(\u0027$1\u0027)" 805 | ], 806 | "triggerAssist": true, 807 | "scope": "source.js", 808 | "prefix": "mmui" 809 | }, 810 | "plus.barcode": { 811 | "body": [ 812 | "plus.barcode." 813 | ], 814 | "triggerAssist": true, 815 | "scope": "source.js", 816 | "prefix": "pbarcode" 817 | }, 818 | "mui.each()": { 819 | "body": [ 820 | "mui.each(${1:obj},function (${2:index},${3:element}) {", 821 | "\t$0", 822 | "})" 823 | ], 824 | "triggerAssist": false, 825 | "scope": "source.js", 826 | "prefix": "meach" 827 | }, 828 | "getElementByIdaddEventListener": { 829 | "body": [ 830 | "document.getElementById(\u0027$1\u0027).addEventListener(\u0027${2:tap}\u0027,function ($3) {", 831 | " $0", 832 | "})" 833 | ], 834 | "triggerAssist": true, 835 | "scope": "source.js", 836 | "prefix": "dga" 837 | }, 838 | "plus.Screen": { 839 | "body": [ 840 | "plus.Screen." 841 | ], 842 | "triggerAssist": true, 843 | "scope": "source.js", 844 | "prefix": "pScreen" 845 | }, 846 | "mui.closePopups()": { 847 | "body": [ 848 | "mui.closePopups()$0" 849 | ], 850 | "triggerAssist": false, 851 | "scope": "source.js", 852 | "prefix": "mdclosePopups" 853 | }, 854 | "mui.currentWebview": { 855 | "body": [ 856 | "mui.currentWebview." 857 | ], 858 | "triggerAssist": true, 859 | "scope": "source.js", 860 | "prefix": "mcurrent" 861 | }, 862 | "plus.maps": { 863 | "body": [ 864 | "plus.maps." 865 | ], 866 | "triggerAssist": true, 867 | "scope": "source.js", 868 | "prefix": "pmaps" 869 | }, 870 | "windowaddEventListener": { 871 | "body": [ 872 | "window.addEventListener(\u0027${1:scroll}\u0027,function ($2) {", 873 | " $0", 874 | "})" 875 | ], 876 | "triggerAssist": true, 877 | "scope": "source.js", 878 | "prefix": "wad" 879 | } 880 | } -------------------------------------------------------------------------------- /snippets/vue-html.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 | "", 173 | "$2", 174 | "" 175 | ], 176 | "description": "条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/platform。" 177 | }, 178 | "uni-app 条件编译,排除某平台": { 179 | "prefix": [ 180 | "#ifndef", 181 | "ifndef" 182 | ], 183 | "body": [ 184 | "", 185 | "$2", 186 | "" 187 | ], 188 | "description": "条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/platform。" 189 | }, 190 | "uni-app 结束条件编译": { 191 | "prefix": [ 192 | "#endif", 193 | "endif" 194 | ], 195 | "body": [ 196 | "" 197 | ], 198 | "description": "结束条件编译。更多信息查看 https://uniapp.dcloud.io/platform。" 199 | }, 200 | "uni-app view": { 201 | "prefix": [ 202 | "view", 203 | "" 204 | ], 205 | "body": [ 206 | "$1$0" 207 | ], 208 | "description": "视图容器,用于包裹各种元素内容。更多信息查看 https://uniapp.dcloud.io/component/view。" 209 | }, 210 | "uni-app scroll-view": { 211 | "prefix": [ 212 | "scroll-view", 213 | "" 214 | ], 215 | "body": [ 216 | "", 217 | "\t$2", 218 | "$0" 219 | ], 220 | "description": "可滚动视图区域。竖向滚动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/scroll-view。" 221 | }, 222 | "uni-app swiper": { 223 | "prefix": [ 224 | "swiper", 225 | "" 226 | ], 227 | "body": [ 228 | "", 233 | "\t$1", 234 | "$0" 235 | ], 236 | "description": "滑块视图容器。子组件只能是 swiper-item。竖向滑动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper。" 237 | }, 238 | "uni-app swiper-item": { 239 | "prefix": [ 240 | "swiper-item", 241 | "" 242 | ], 243 | "body": [ 244 | "$1$0" 245 | ], 246 | "description": "只能是 swiper 的子组件,宽高自动设置为 100%。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper-item。" 247 | }, 248 | "uni-app match-media": { 249 | "prefix": [ 250 | "match-media", 251 | "" 252 | ], 253 | "body": [ 254 | "$2$0" 255 | ], 256 | "description": "可适配不同屏幕的基本视图组件。更多信息查看 https://uniapp.dcloud.io/component/match-media。" 257 | }, 258 | "uni-app movable-area": { 259 | "prefix": [ 260 | "movable-area", 261 | "" 262 | ], 263 | "body": [ 264 | "", 265 | "\t", 272 | "\t\t$7", 273 | "\t", 274 | "$0" 275 | ], 276 | "description": "可拖动区域组件,指代可拖动的范围。子组件只能是 movable-view。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-area。" 277 | }, 278 | "uni-app movable-view": { 279 | "prefix": [ 280 | "movable-view", 281 | "" 282 | ], 283 | "body": [ 284 | "", 291 | "\t$6", 292 | "$0" 293 | ], 294 | "description": "可移动的视图容器。只能是 movable-area 的子组件。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-view。" 295 | }, 296 | "uni-app cover-view": { 297 | "prefix": [ 298 | "cover-view", 299 | "" 300 | ], 301 | "body": [ 302 | "$1$0" 303 | ], 304 | "description": "覆盖在原生组件上的文本视图。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-view。" 305 | }, 306 | "uni-app cover-image": { 307 | "prefix": [ 308 | "cover-image", 309 | "" 310 | ], 311 | "body": [ 312 | "$0" 313 | ], 314 | "description": "覆盖在原生组件上的图片视图。可以嵌套在 cover-view 里。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-image。" 315 | }, 316 | "uni-app icon": { 317 | "prefix": [ 318 | "icon", 319 | "" 320 | ], 321 | "body": [ 322 | "$0" 327 | ], 328 | "description": "图标。更多信息查看 https://uniapp.dcloud.io/component/icon。" 329 | }, 330 | "uni-app text": { 331 | "prefix": [ 332 | "text", 333 | "" 334 | ], 335 | "body": [ 336 | "$1$0" 337 | ], 338 | "description": "文本组件。用于包裹文本内容。更多信息查看 https://uniapp.dcloud.io/component/text。" 339 | }, 340 | "uni-app rich-text": { 341 | "prefix": [ 342 | "rich-text", 343 | "" 344 | ], 345 | "body": [ 346 | "$0" 347 | ], 348 | "description": "富文本。更多信息查看 https://uniapp.dcloud.io/component/rich-text。" 349 | }, 350 | "uni-app progress": { 351 | "prefix": [ 352 | "progress", 353 | "" 354 | ], 355 | "body": [ 356 | "$0" 357 | ], 358 | "description": "进度条。更多信息查看 https://uniapp.dcloud.io/component/progress。" 359 | }, 360 | "uni-app button": { 361 | "prefix": [ 362 | "button", 363 | "$0" 375 | ], 376 | "description": "按钮。更多信息查看 https://uniapp.dcloud.io/component/button。" 377 | }, 378 | "uni-app checkbox-group": { 379 | "prefix": [ 380 | "checkbox-group", 381 | "" 382 | ], 383 | "body": [ 384 | "", 385 | "\t", 392 | "$0" 393 | ], 394 | "description": "多选框组。更多信息查看 https://uniapp.dcloud.io/component/checkbox?id=checkbox-group。" 395 | }, 396 | "uni-app checkbox": { 397 | "prefix": [ 398 | "checkbox", 399 | "" 400 | ], 401 | "body": [ 402 | "$0" 406 | ], 407 | "description": "多选框。更多信息查看 https://uniapp.dcloud.io/component/checkbox?id=checkbox。" 408 | }, 409 | "uni-app editor": { 410 | "prefix": [ 411 | "editor", 412 | "" 413 | ], 414 | "body": [ 415 | "$0" 416 | ], 417 | "description": "富文本编辑器,可以对图片、文字格式进行编辑和混排。更多信息查看 https://uniapp.dcloud.io/component/editor。" 418 | }, 419 | "uni-app form": { 420 | "prefix": [ 421 | "form", 422 | "
" 423 | ], 424 | "body": [ 425 | "", 429 | "\t$3", 430 | "\t", 431 | "\t", 432 | "$0" 433 | ], 434 | "description": "表单,将组件内的用户输入的 switch input checkbox slider radio picker 提交。更多信息查看 https://uniapp.dcloud.io/component/form。" 435 | }, 436 | "uni-app input": { 437 | "prefix": [ 438 | "input", 439 | "" 440 | ], 441 | "body": [ 442 | "$0" 448 | ], 449 | "description": "输入框。更多信息查看 https://uniapp.dcloud.io/component/input。" 450 | }, 451 | "uni-app label": { 452 | "prefix": [ 453 | "label", 454 | "