Skip to content

Commit

Permalink
feat: add wxml support
Browse files Browse the repository at this point in the history
  • Loading branch information
Hongbusi committed Jan 22, 2024
1 parent b7e6268 commit c4d3ef7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Support `.html` and `.vue` files. Reference link: [https://developer.mozilla.org
| `log` | `console.log(...)` |
| `log` | `console.log('... :>> ', ...)` |
| `todo` | `// TODO ...` |
| `set` | `this.setData({ ... })` |
| `bi` | `this._collect.bi('...', ...)` |
| `elk` | `this._collect.elk('...', ...)` |
| `business` | `this._collect.business('...', ...)` |
| `alert` | `Actions.Toast.alert('...')` |
| `fail` | `Actions.Toast.fail('...')` |
| `success` | `Actions.Toast.success('...')` |
| `select` | `Actions.Modal.select('...', '...', {...})` |

### Vue

Expand Down
64 changes: 64 additions & 0 deletions snippets/wxml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"setData": {
"prefix": "set",
"body": [
"this.setData({$0})"
],
"description": "setData"
},
"collectBi": {
"prefix": "bi",
"body": [
"this._collect.bi('${1:fid}', ${2:params})"
],
"description": "collectBi"
},
"collectElk": {
"prefix": "elk",
"body": [
"this._collect.elk('${1:fid}', ${2:params})"
],
"description": "collectElk"
},
"collectBusiness": {
"prefix": "business",
"body": [
"this._collect.business('${1:fid}', ${2:params})"
],
"description": "collectBusiness"
},
"Actions.Toast.alert": {
"prefix": "alert",
"body": [
"Actions.Toast.alert('$0')"
],
"description": "Actions.Toast.alert"
},
"Actions.Toast.fail": {
"prefix": "fail",
"body": [
"Actions.Toast.fail('$0')"
],
"description": "Actions.Toast.fail"
},
"Actions.Toast.success": {
"prefix": "success",
"body": [
"Actions.Toast.success('$0')"
],
"description": "Actions.Toast.success"
},
"Actions.Modal.select": {
"prefix": "select",
"body": [
"Actions.Modal.select('${1:modalContent}', '${2:confirmText}', {",
" success: (ret) => {",
" if (ret) {",
" ${3:// TODO thing}",
" }",
" },",
"})"
],
"description": "Actions.Modal.select"
}
}

0 comments on commit c4d3ef7

Please sign in to comment.