mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
Compare commits
440 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e5af691c4c | ||
|
c6b4004893 | ||
|
db1c0ce662 | ||
|
1a8351387a | ||
|
2543148507 | ||
|
2266cbe262 | ||
|
809bc84d1e | ||
|
e5f462263b | ||
|
22f39e86b9 | ||
|
ff982f6cd0 | ||
|
178795253f | ||
|
443e78daec | ||
|
07dfcafb26 | ||
|
ebba3b14a1 | ||
|
04c8783b1d | ||
|
c38c931325 | ||
|
ab45d8011c | ||
|
8953dd3ed9 | ||
|
2680fedace | ||
|
68be39fea2 | ||
|
979fc92bdc | ||
|
348c3103b7 | ||
|
50da9f87eb | ||
|
fc1ad93c57 | ||
|
902579a94a | ||
|
cce61c26af | ||
|
5b9f52b7ef | ||
|
aac785bc2c | ||
|
4db5b132d1 | ||
|
c7e8ab5ef3 | ||
|
9130ebf59c | ||
|
cdb692fbec | ||
|
b9f88ec64a | ||
|
c0b7537da9 | ||
|
c4b3609370 | ||
|
040416bdb7 | ||
|
7c0c9e43f7 | ||
|
ff8fe1cb69 | ||
|
628008efb3 | ||
|
3f8cc449d2 | ||
|
e2b031c436 | ||
|
d1f505b8e8 | ||
|
19083a327c | ||
|
f2ff0e7b48 | ||
|
d0610c09ac | ||
|
c3ae27b4b0 | ||
|
d869a8149f | ||
|
864a890e83 | ||
|
1d0600cece | ||
|
5b7dc9a4ab | ||
|
eeea4a8434 | ||
|
f98cf75027 | ||
|
3e6e157c6a | ||
|
8af9924056 | ||
|
05ec5e2526 | ||
|
7d438e2843 | ||
|
3e9cdcfd7c | ||
|
36d0add734 | ||
|
27979cf894 | ||
|
98874a155c | ||
|
14b97ead79 | ||
|
b936371007 | ||
|
1939b76a04 | ||
|
be99bd3bd3 | ||
|
bc649cff58 | ||
|
42447bb87c | ||
|
f330cf2a34 | ||
|
7423e18ae3 | ||
|
8ce21a6446 | ||
|
18ffa1891d | ||
|
6dd89841a8 | ||
|
3da43a131c | ||
|
3e06aa4e89 | ||
|
fd41bd823a | ||
|
b9dea4fd16 | ||
|
de8d8359f3 | ||
|
48a0bf0351 | ||
|
511adf7f5d | ||
|
d692b708af | ||
|
610ce18859 | ||
|
6d6d6d736b | ||
|
fd95792040 | ||
|
ea8f92f919 | ||
|
88a36b5647 | ||
|
f975d2b37d | ||
|
589be648f2 | ||
|
713f694aa0 | ||
|
c99f464360 | ||
|
e0abf6effc | ||
|
78c518bae8 | ||
|
9ead748d91 | ||
|
8021e7cdfd | ||
|
dec405d770 | ||
|
e67ff09e37 | ||
|
4756994212 | ||
|
799a06379d | ||
|
917ab22907 | ||
|
7498ed12c3 | ||
|
f197c5f3c3 | ||
|
f26de0cbb0 | ||
|
8309c27297 | ||
|
fa04172e5b | ||
|
b005b41c4e | ||
|
2c7629fe07 | ||
|
bc3d307c4d | ||
|
a3117538b3 | ||
|
d72580fe7d | ||
|
3d1d27641b | ||
|
22acb8ddbc | ||
|
35d8346647 | ||
|
a232ec525f | ||
|
d235ae6574 | ||
|
b01a768557 | ||
|
bcdd2961be | ||
|
8fba87ee74 | ||
|
c5ffb225ba | ||
|
ec6d90fcc5 | ||
|
35b199f9f6 | ||
|
1ad122b9cf | ||
|
e8ed007d89 | ||
|
7decaed8e4 | ||
|
8697c56b85 | ||
|
ba927da0ea | ||
|
0d6d54d199 | ||
|
ffb1fe6053 | ||
|
a0b0bd163d | ||
|
cf682f6634 | ||
|
31d255d57e | ||
|
344b1b0f69 | ||
|
f1ad8d4b56 | ||
|
51bd751453 | ||
|
4b86663562 | ||
|
97af57cee9 | ||
|
53e4a0d3f9 | ||
|
10795bf325 | ||
|
a6005980c9 | ||
|
a140117e8b | ||
|
8715142079 | ||
|
9f1a52ea15 | ||
|
9c57499824 | ||
|
6dd828ce90 | ||
|
4ccb1eeb67 | ||
|
09bdbccb93 | ||
|
57859ac402 | ||
|
6234035799 | ||
|
ccbbe1e9f6 | ||
|
08f3a41a3e | ||
|
767da88bc6 | ||
|
2796a2b0fa | ||
|
64efb4d204 | ||
|
33858004a1 | ||
|
8102e79531 | ||
|
eb56755fd7 | ||
|
9cbc1662a8 | ||
|
f72584bed2 | ||
|
cbc6cc88b1 | ||
|
b54f78328d | ||
|
629603e7b0 | ||
|
a95769652b | ||
|
31b17e910b | ||
|
0e285b130a | ||
|
914c659d56 | ||
|
0b02eeb4c3 | ||
|
d1be0b3c8b | ||
|
8f28e6ae42 | ||
|
071650a37b | ||
|
9271152ec2 | ||
|
33a7e55a71 | ||
|
e0df0181f2 | ||
|
747b30597a | ||
|
9e6832bf85 | ||
|
a1a1af37f1 | ||
|
5d8ebb2e45 | ||
|
4a3dbff38b | ||
|
05f6159df8 | ||
|
aa445fddb7 | ||
|
dc5d55d599 | ||
|
eff8276d9f | ||
|
2f80362b7b | ||
|
b879138508 | ||
|
466b9b5504 | ||
|
25ade8883b | ||
|
88bd66c78e | ||
|
588ba18b75 | ||
|
9c5c8ce9f0 | ||
|
e4fefa4d3f | ||
|
37735ca967 | ||
|
b5f7e24f38 | ||
|
160ae75689 | ||
|
d55a90841f | ||
|
ff4e11a485 | ||
|
613ed8cf94 | ||
|
2f03defe1c | ||
|
09d7d4f69f | ||
|
7a161f2153 | ||
|
3d89e1565e | ||
|
9b1a489c2d | ||
|
cdcdaa2c48 | ||
|
700a1ed644 | ||
|
db89819f9e | ||
|
0e425098af | ||
|
4fd22f0a6b | ||
|
6f175b2818 | ||
|
af66e3d78c | ||
|
11e69b1e4c | ||
|
4389ba378a | ||
|
7a0e89fb14 | ||
|
1abe403726 | ||
|
a3c5a99031 | ||
|
d0d757a665 | ||
|
f86c1fd1f2 | ||
|
17c96a1827 | ||
|
79c50951a5 | ||
|
6b9af20525 | ||
|
d69ec23b88 | ||
|
77c765d451 | ||
|
3a4baaff41 | ||
|
17b9eadcb0 | ||
|
9352b33673 | ||
|
cf36c8ebbd | ||
|
0fc6103e1b | ||
|
05028b42ac | ||
|
987e82cc4b | ||
|
734db65203 | ||
|
f05db09646 | ||
|
8c48a03831 | ||
|
bcae47b8d0 | ||
|
3d0615e042 | ||
|
98747aacf7 | ||
|
247e8ca9fc | ||
|
c7f2f45430 | ||
|
840baf4341 | ||
|
66867f6054 | ||
|
357fd0e7e5 | ||
|
96923a4c75 | ||
|
be68dc6868 | ||
|
439d17e0f7 | ||
|
92ae4a29c0 | ||
|
183c980bd2 | ||
|
db79570d98 | ||
|
94bd6ada78 | ||
|
e38973c969 | ||
|
f0ee820588 | ||
|
b028cd7868 | ||
|
acdf1ad280 | ||
|
2c9765ea08 | ||
|
7cec5690ce | ||
|
231aa05e8d | ||
|
e9d521a8d2 | ||
|
965734328c | ||
|
d14ac6027a | ||
|
0c372115da | ||
|
b2fabe6b2b | ||
|
7160828cf1 | ||
|
e46d11f837 | ||
|
9771499383 | ||
|
099937bc8f | ||
|
7fdb7fbf03 | ||
|
6ca6bb896c | ||
|
3936e5f799 | ||
|
ac75900d3f | ||
|
484613d22e | ||
|
38e617227d | ||
|
49f611bf67 | ||
|
f59e5afddf | ||
|
4f8981ab0d | ||
|
924d04b5a3 | ||
|
d4cf2154fe | ||
|
a80767e9c1 | ||
|
72476e639d | ||
|
5f7150d980 | ||
|
e4ad5cc51a | ||
|
3a716ea15b | ||
|
fad9e9d85d | ||
|
e4952f28e4 | ||
|
33e1725b0a | ||
|
91a12bbaaf | ||
|
76522a173f | ||
|
e7426dba36 | ||
|
5ef53f25e0 | ||
|
bcafa2b894 | ||
|
786448ac2e | ||
|
f1b99f8f13 | ||
|
5cfc98275d | ||
|
98cb9c04ea | ||
|
ff67d50ccc | ||
|
af74936bdc | ||
|
011fa00577 | ||
|
4bb9e62538 | ||
|
2cfad3e607 | ||
|
91b2e6ce92 | ||
|
9c9822ef58 | ||
|
fd3b26b365 | ||
|
830a68c511 | ||
|
c1abd0052f | ||
|
270474f541 | ||
|
ebbc7a3e68 | ||
|
88eb9379a9 | ||
|
845ce17cfe | ||
|
d86d4a6a5f | ||
|
9098f427bf | ||
|
5b96c7acb0 | ||
|
a13c7348a2 | ||
|
71f5e3422f | ||
|
84dde64d74 | ||
|
61d7a3e5cf | ||
|
13b3f9a7d1 | ||
|
345027906d | ||
|
c6bff2718a | ||
|
56cc44f60e | ||
|
09360b2df3 | ||
|
3f6403f5b3 | ||
|
8b441de1a6 | ||
|
c118b83aeb | ||
|
c55c785a9e | ||
|
406d7200ab | ||
|
c4639f5e47 | ||
|
63e1f966d7 | ||
|
4700001f32 | ||
|
01a389c58b | ||
|
f4c71d3d56 | ||
|
a396085bef | ||
|
d39b35fc3a | ||
|
124c208646 | ||
|
697746fb47 | ||
|
3c3978df3e | ||
|
05c04682ad | ||
|
b056f1855f | ||
|
3599fdab83 | ||
|
93aafc4180 | ||
|
082ae1d66a | ||
|
46b8d053e3 | ||
|
66c967b782 | ||
|
763acff12a | ||
|
3ff95e01ad | ||
|
abeddfd09d | ||
|
0b5dafa8d2 | ||
|
5c9859f1f1 | ||
|
5e87650fe2 | ||
|
eb50789df3 | ||
|
3049271aa5 | ||
|
917e60195f | ||
|
c380b8ac32 | ||
|
e33a07730a | ||
|
72bd8b88fb | ||
|
4aacb6184c | ||
|
bbf2d0de31 | ||
|
aea30546dc | ||
|
b66b85eb97 | ||
|
186b0156df | ||
|
a41e7734eb | ||
|
9d96e248f4 | ||
|
8ec17cc87d | ||
|
e87c22edec | ||
|
bbce66886c | ||
|
a8d5999d89 | ||
|
b1b2a9135c | ||
|
f70512cbf8 | ||
|
ba064e5a71 | ||
|
9789f68d71 | ||
|
0d71d8068d | ||
|
842e88f115 | ||
|
9a708747a8 | ||
|
8220552f66 | ||
|
06c2457513 | ||
|
0d3694c9d7 | ||
|
fe69d2d6cb | ||
|
ecbde11a51 | ||
|
d965fa6934 | ||
|
5cf03cfd3b | ||
|
f9f121f582 | ||
|
25699c19ec | ||
|
7e84eb5bd1 | ||
|
f888e77cd2 | ||
|
e21dbd0d66 | ||
|
6997c225a9 | ||
|
878814c98f | ||
|
0e966a504f | ||
|
7b2c0aabd6 | ||
|
bdcda89b20 | ||
|
71de9bc2c9 | ||
|
1c5a8d7fab | ||
|
9fc1616a4e | ||
|
222a0f9de9 | ||
|
85f28dd52c | ||
|
be710fbf8b | ||
|
61bdd5739f | ||
|
f0957b5de2 | ||
|
3a9056ff1d | ||
|
5c90a4ff77 | ||
|
5afa64c98f | ||
|
45e307903e | ||
|
0d61b6283a | ||
|
d4bfa974ee | ||
|
449dd77022 | ||
|
dca337e6b3 | ||
|
386e667f8e | ||
|
a796727276 | ||
|
84aa684b47 | ||
|
09dfab8cb8 | ||
|
37a46ae95a | ||
|
a12b50b91d | ||
|
52aa2f08d3 | ||
|
8469a6b53a | ||
|
0b24f3a862 | ||
|
7beead625a | ||
|
98d9e352c2 | ||
|
5854fe1274 | ||
|
d449ec56d5 | ||
|
e95a3013b1 | ||
|
9c1d9fd7b0 | ||
|
e9cc6bceb9 | ||
|
bc94e23885 | ||
|
559391bc07 | ||
|
8c1830ed6c | ||
|
99a66b4d35 | ||
|
1e7cbe30fb | ||
|
befa6f08bd | ||
|
e719a2cbe5 | ||
|
37a9d1ffce | ||
|
8d8d983fef | ||
|
c2d83f0956 | ||
|
e17d8acb8c | ||
|
74ee24aa24 | ||
|
42565fd930 | ||
|
850b38241a | ||
|
73932fc691 | ||
|
4871aae6d5 | ||
|
9919e8b2cf | ||
|
83c90c4624 | ||
|
0b0cca10b1 | ||
|
2ae1938b46 | ||
|
d82bf5278a | ||
|
06e1f066a0 | ||
|
a8d6c351af | ||
|
639527add9 | ||
|
01795cacf6 | ||
|
48d22b018a | ||
|
fbef9bd81f | ||
|
1fd4f61400 |
@ -1,3 +1,3 @@
|
|||||||
你好,请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。
|
你好,请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。
|
||||||
|
|
||||||
http://vant-contrib.gitee.io/vant-issue-generater?repo=VantWeapp
|
http://vant-ui.github.io/vant-issue-generater?repo=VantWeapp
|
||||||
|
3
.github/ISSUE_TEMPLATE.md
vendored
3
.github/ISSUE_TEMPLATE.md
vendored
@ -1,3 +0,0 @@
|
|||||||
你好,请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。
|
|
||||||
|
|
||||||
http://vant-contrib.gitee.io/vant-issue-generater?repo=VantWeapp
|
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
blank_issues_enabled: false
|
56
.github/ISSUE_TEMPLATE/template-1-bug-report-vant.zh-CN.yml
vendored
Normal file
56
.github/ISSUE_TEMPLATE/template-1-bug-report-vant.zh-CN.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: 我要反馈 Vant Weapp 的 Bug
|
||||||
|
description: 通过标准模板进行 Bug 反馈
|
||||||
|
title: "[Bug Report] 请在此填写标题"
|
||||||
|
labels: ["bug: need confirm"]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
在提交 Bug 报告前,请注意:
|
||||||
|
|
||||||
|
- 确认你的问题无法通过官方文档得到解决。
|
||||||
|
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant-weapp/issues),并且没有发现同样的问题。
|
||||||
|
- 如果不是反馈 Bug,请到 [Discussions 讨论区](https://github.com/youzan/vant-weapp/discussions) 发帖。
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduce
|
||||||
|
attributes:
|
||||||
|
label: 重现链接
|
||||||
|
description: 请提供一个尽可能简单的微信小程序代码片段协助我们排查,这可以更快的帮助我们定位问题,解决 issue。
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: Vant Weapp 版本
|
||||||
|
description: 你正在使用的 Vant Weapp 版本是多少?(请填写 node_modules/@vant/weapp/package.json 里实际安装的版本)
|
||||||
|
placeholder: 比如 1.10.5
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: 描述一下你遇到的问题。
|
||||||
|
placeholder: 比如:弹窗无法展示、日历组件报错
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduce-steps
|
||||||
|
attributes:
|
||||||
|
label: 重现步骤
|
||||||
|
description: 请提供一个最简单的操作步骤,方便我们快速重现问题。
|
||||||
|
placeholder: |
|
||||||
|
比如:
|
||||||
|
1. 点击按钮
|
||||||
|
2. 弹窗无法展示
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: browsers
|
||||||
|
attributes:
|
||||||
|
label: 设备/浏览器
|
||||||
|
description: 在哪些设备/浏览器上能重现这个问题?
|
33
.github/ISSUE_TEMPLATE/template-3-feature-request-vant.zh-CN.yml
vendored
Normal file
33
.github/ISSUE_TEMPLATE/template-3-feature-request-vant.zh-CN.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: 我想要一个 Vant Weapp 的新功能
|
||||||
|
description: 通过标准模板描述一下你的功能需求。
|
||||||
|
title: "[Feature Request] 请在此填写标题"
|
||||||
|
labels: ["feature: need confirm"]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
在提交功能需求前,请注意:
|
||||||
|
|
||||||
|
- 确认这是一个通用功能,并且无法通过现有的 API 或 Slot 实现。
|
||||||
|
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant-weapp/issues),并且没有发现同样的需求。
|
||||||
|
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant-weapp/discussions) 发帖,讨论一下需求是否合理。
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: 这个功能解决了什么问题?
|
||||||
|
description: 请尽可能详细地说明这个功能的使用场景。
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: api
|
||||||
|
attributes:
|
||||||
|
label: 你期望的 API 是什么样子的?
|
||||||
|
description: 描述一下这个新功能的 API,并提供一些代码示例。
|
||||||
|
placeholder: |
|
||||||
|
```xml
|
||||||
|
<van-button some-prop="xxx" />
|
||||||
|
```
|
||||||
|
validations:
|
||||||
|
required: true
|
10
.github/pr-labeler.yml
vendored
Normal file
10
.github/pr-labeler.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
"change: feat":
|
||||||
|
- "/^(feat|types|style)/"
|
||||||
|
"change: fix":
|
||||||
|
- "/^fix/"
|
||||||
|
"change: perf":
|
||||||
|
- "/^perf/"
|
||||||
|
"change: breaking":
|
||||||
|
- "/^breaking change/"
|
||||||
|
"change: docs":
|
||||||
|
- "/^docs/"
|
18
.github/workflows/deploy-site.yml
vendored
18
.github/workflows/deploy-site.yml
vendored
@ -4,7 +4,10 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [dev]
|
branches: [dev]
|
||||||
paths:
|
paths:
|
||||||
- 'docs/**'
|
- 'docs/**/*.md'
|
||||||
|
- 'packages/**/*.md'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
@ -21,9 +24,16 @@ jobs:
|
|||||||
- name: Build Site
|
- name: Build Site
|
||||||
run: npx --no-install vant-cli build-site
|
run: npx --no-install vant-cli build-site
|
||||||
|
|
||||||
- name: Deploy 🚀
|
- name: Deploy for GitHub 🚀
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.1
|
uses: JamesIves/github-pages-deploy-action@v4.6.0
|
||||||
with:
|
with:
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
folder: site-dist
|
folder: site-dist
|
||||||
clean-exclude: 0.x
|
token: ${{ secrets.VANT_UI_TOKEN }}
|
||||||
|
repository-name: vant-ui/vant-ui.github.io
|
||||||
|
target-folder: vant-weapp
|
||||||
|
# enable single-commit to reduce the repo size
|
||||||
|
single-commit: true
|
||||||
|
clean: true
|
||||||
|
clean-exclude: |
|
||||||
|
0.x
|
||||||
|
20
.github/workflows/pr-label.yaml
vendored
Normal file
20
.github/workflows/pr-label.yaml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: PR Labeler
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- edited
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
change-labeling:
|
||||||
|
name: Labeling for changes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: github/issue-labeler@v3.4
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
configuration-path: .github/pr-labeler.yml
|
||||||
|
enable-versioned-regex: 0
|
||||||
|
include-title: 1
|
||||||
|
sync-labels: 1
|
11
.github/workflows/release-tag.yml
vendored
11
.github/workflows/release-tag.yml
vendored
@ -11,13 +11,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Create Release for Tag
|
- name: Create Release for Tag
|
||||||
id: release_tag
|
id: release_tag
|
||||||
uses: yyx990803/release-tag@master
|
uses: ncipollo/release-action@v1
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
generateReleaseNotes: "true"
|
||||||
body: |
|
body: |
|
||||||
更新内容参见 [CHANGELOG](https://vant-contrib.gitee.io/vant-weapp/#/changelog)。
|
> 请访问 [更新日志](https://vant-ui.github.io/vant-weapp/#/changelog) 了解所有更新。
|
||||||
|
20
.github/workflows/sync-gitee.yml
vendored
20
.github/workflows/sync-gitee.yml
vendored
@ -1,20 +0,0 @@
|
|||||||
name: Sync to Gitee
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [dev, gh-pages]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Sync to Gitee
|
|
||||||
uses: wearerequired/git-mirror-action@master
|
|
||||||
env:
|
|
||||||
# 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
|
|
||||||
with:
|
|
||||||
# 注意替换为你的 GitHub 源仓库地址
|
|
||||||
source-repo: git@github.com:youzan/vant-weapp.git
|
|
||||||
# 注意替换为你的 Gitee 目标仓库地址
|
|
||||||
destination-repo: git@gitee.com:vant-contrib/vant-weapp.git
|
|
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: bahmutov/npm-install@v1
|
uses: bahmutov/npm-install@v1
|
||||||
@ -20,10 +20,15 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: szenius/set-timezone@v1.0
|
||||||
|
with:
|
||||||
|
timezoneLinux: "Asia/Shanghai"
|
||||||
|
timezoneMacos: "Asia/Shanghai"
|
||||||
|
timezoneWindows: "China Standard Time"
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: bahmutov/npm-install@v1
|
uses: bahmutov/npm-install@v1
|
||||||
@ -42,7 +47,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '14.x'
|
node-version: '18.x'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
uses: bahmutov/npm-install@v1
|
uses: bahmutov/npm-install@v1
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ example/dist
|
|||||||
changelog.generated.md
|
changelog.generated.md
|
||||||
package-lock.json
|
package-lock.json
|
||||||
build/private.wx1c01b35002d3ba14.key
|
build/private.wx1c01b35002d3ba14.key
|
||||||
|
project.private.config.json
|
||||||
|
30
README.md
30
README.md
@ -11,24 +11,24 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
🔥 <a href="https://vant-contrib.gitee.io/vant-weapp">文档网站(国内)</a>
|
🔥 <a href="https://vant.pro/vant-weapp/">文档网站(国内)</a>
|
||||||
|
|
||||||
🌈 <a href="https://youzan.github.io/vant-weapp">文档网站(GitHub)</a>
|
🔥 <a href="https://vant-ui.github.io/vant-weapp/">文档网站(GitHub)</a>
|
||||||
|
|
||||||
🚀 <a href="https://github.com/youzan/vant" target="_blank">Vue 版</a>
|
🚀 <a href="https://github.com/vant-ui/vant" target="_blank">Vue 版</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 介绍
|
### 介绍
|
||||||
|
|
||||||
Vant 是**有赞前端团队**开源的移动端组件库,于 2017 年开源,已持续维护 4 年时间。Vant 对内承载了有赞所有核心业务,对外服务十多万开发者,是业界主流的移动端组件库之一。
|
Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
|
||||||
|
|
||||||
目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant)、[Vue 3 版本](https://vant-contrib.gitee.io/vant/v3)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/mxdi9i7/vant-react)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
|
目前 Vant 官方提供了 [Vue 2 版本](https://vant-ui.github.io/vant/v2/)、[Vue 3 版本](https://vant-ui.github.io/vant/)和[微信小程序版本](http://vant-ui.github.io/vant-weapp/),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
|
||||||
|
|
||||||
## 预览
|
## 预览
|
||||||
|
|
||||||
扫描下方小程序二维码,体验组件库示例:
|
扫描下方小程序二维码,体验组件库示例。注意:因微信审核机制限制,目前示例小程序不是最新版本,可以 clone 代码到本地开发工具预览
|
||||||
|
|
||||||
<img src="https://img.yzcdn.cn/vant-weapp/qrcode-201808101114.jpg" width="200" height="200" style="margin-top: 10px;" >
|
<img src="https://img.yzcdn.cn/vant-weapp/qrcode-201808101114.jpg" width="200" height="200" style="margin-top: 10px;" >
|
||||||
|
|
||||||
@ -99,18 +99,24 @@ Vant Weapp 最低支持到小程序基础库 2.6.5 版本。
|
|||||||
|
|
||||||
## 链接
|
## 链接
|
||||||
|
|
||||||
- [更新日志](https://github.com/youzan/vant-weapp/blob/dev/docs/markdown/changelog.md)
|
- [文档网站(GitHub)](https://vant-ui.github.io/vant-weapp/)
|
||||||
|
- [文档网站(国内)](https://vant.pro/vant-weapp/)
|
||||||
- [意见反馈](https://github.com/youzan/vant-weapp/issues)
|
- [意见反馈](https://github.com/youzan/vant-weapp/issues)
|
||||||
- [加入我们](https://job.youzan.com)
|
- [设计资源](https://vant-ui.github.io/vant/#/zh-CN/design)
|
||||||
- [Vant Vue 版](https://github.com/youzan/vant)
|
- [更新日志](https://vant-ui.github.io/vant-weapp/#/changelog)
|
||||||
|
- [官方示例](https://github.com/vant-ui/vant-demo)
|
||||||
|
|
||||||
## 核心团队
|
## 核心团队
|
||||||
|
|
||||||
以下是 Vant 和 Vant Weapp 的核心贡献者们:
|
以下是 Vant 和 Vant Weapp 的核心贡献者们:
|
||||||
|
|
||||||
| [](https://github.com/chenjiahan/) | [](https://github.com/cookfront/) | [](https://github.com/w91/) | [](https://github.com/pangxie1991/) | [](https://github.com/rex-zsd/) | [](https://github.com/nemo-shen/) | [](https://github.com/Lindysen/) | [](https://github.com/JakeLaoyu/) |
|
| [](https://github.com/chenjiahan/) | [](https://github.com/cookfront/) | [](https://github.com/w91/) | [](https://github.com/pangxie1991/) | [](https://github.com/rex-zsd/) | [](https://github.com/nemo-shen/) |
|
||||||
| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|
| :-: | :-: | :-: | :-: | :-: | :-: |
|
||||||
| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) |
|
| [chenjiahan](https://github.com/chenjiahan/) | [cookfront](https://github.com/cookfront/) | [wangnaiyi](https://github.com/w91/) | [pangxie](https://github.com/pangxie1991/) | [rex-zsd](https://github.com/rex-zsd/) | [nemo-shen](https://github.com/nemo-shen/) |
|
||||||
|
|
||||||
|
| [](https://github.com/Lindysen/) | [](https://github.com/JakeLaoyu/) | [](https://github.com/landluck/) | [](https://github.com/wjw-gavin/) | [](https://github.com/inottn/) | [](https://github.com/zhousg/) |
|
||||||
|
| :-: | :-: | :-: | :-: | :-: | :-: |
|
||||||
|
| [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | [landluck](https://github.com/landluck/) | [wjw-gavin](https://github.com/wjw-gavin/) | [inottn](https://github.com/inottn/) | [zhousg](https://github.com/zhousg/) |
|
||||||
|
|
||||||
## 贡献者们
|
## 贡献者们
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ const rename = require('gulp-rename');
|
|||||||
const postcss = require('gulp-postcss');
|
const postcss = require('gulp-postcss');
|
||||||
const ts = require('gulp-typescript');
|
const ts = require('gulp-typescript');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
|
const merge2 = require('merge2');
|
||||||
const exec = util.promisify(require('child_process').exec);
|
const exec = util.promisify(require('child_process').exec);
|
||||||
|
|
||||||
const src = path.resolve(__dirname, '../packages');
|
const src = path.resolve(__dirname, '../packages');
|
||||||
@ -54,26 +55,31 @@ const lessCompiler = (dist) =>
|
|||||||
|
|
||||||
const tsCompiler = (dist, config) =>
|
const tsCompiler = (dist, config) =>
|
||||||
function compileTs() {
|
function compileTs() {
|
||||||
const tsProject = ts.createProject(config);
|
const tsProject = ts.createProject(config, {
|
||||||
return tsProject
|
declaration: true,
|
||||||
.src()
|
});
|
||||||
.pipe(tsProject())
|
const tsResult = tsProject.src().pipe(tsProject());
|
||||||
.js.pipe(
|
|
||||||
insert.transform((contents, file) => {
|
return merge2(
|
||||||
if (dist === exampleDistDir && file.path.includes('/demo/')) {
|
tsResult.js
|
||||||
const iconConfig = '@vant/icons/src/config';
|
.pipe(
|
||||||
contents = contents.replace(
|
insert.transform((contents, file) => {
|
||||||
iconConfig,
|
if (dist === exampleDistDir && file.path.includes(`${path.sep}demo${path.sep}`)) {
|
||||||
path.relative(
|
const iconConfig = '@vant/icons/src/config';
|
||||||
path.dirname(file.path),
|
contents = contents.replace(
|
||||||
`${exampleDistDir}/${iconConfig}`
|
iconConfig,
|
||||||
)
|
path.relative(
|
||||||
);
|
path.dirname(file.path),
|
||||||
}
|
`${exampleDistDir}/${iconConfig}`
|
||||||
return contents;
|
).replace(/\\/g, '/')
|
||||||
})
|
);
|
||||||
)
|
}
|
||||||
.pipe(gulp.dest(dist));
|
return contents;
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.pipe(gulp.dest(dist)),
|
||||||
|
tsResult.dts.pipe(gulp.dest(dist))
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const copier = (dist, ext) =>
|
const copier = (dist, ext) =>
|
||||||
@ -86,7 +92,7 @@ const copier = (dist, ext) =>
|
|||||||
.src(srcPath)
|
.src(srcPath)
|
||||||
.pipe(
|
.pipe(
|
||||||
insert.transform((contents, file) => {
|
insert.transform((contents, file) => {
|
||||||
if (ext === 'json' && file.path.includes('/demo/')) {
|
if (ext === 'json' && file.path.includes(`${path.sep}demo${path.sep}`) ) {
|
||||||
contents = contents.replace('/example', '');
|
contents = contents.replace('/example', '');
|
||||||
}
|
}
|
||||||
return contents;
|
return contents;
|
||||||
|
15
build/dev.js
15
build/dev.js
@ -1,15 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const { dev } = require('@vant/cli');
|
|
||||||
const { exec } = require('child_process');
|
|
||||||
|
|
||||||
const gulpConfig = path.resolve(__dirname, './compiler.js');
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
await dev();
|
|
||||||
|
|
||||||
const p = exec(`npx gulp -f ${gulpConfig} buildExample --color`);
|
|
||||||
p.stdout.on('data', (stdout) => console.info(stdout));
|
|
||||||
p.stderr.on('data', (stderr) => console.info(stderr));
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
17
build/dev.mjs
Normal file
17
build/dev.mjs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { dirname, resolve } from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
import { dev } from '@vant/cli/lib/commands/dev.js';
|
||||||
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
const gulpConfig = resolve(__dirname, './compiler.js');
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
await dev();
|
||||||
|
|
||||||
|
const p = exec(`npx gulp -f ${gulpConfig} buildExample --color`);
|
||||||
|
p.stdout.on('data', (stdout) => console.info(stdout));
|
||||||
|
p.stderr.on('data', (stderr) => console.info(stderr));
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
@ -28,7 +28,4 @@ then
|
|||||||
else
|
else
|
||||||
npm publish
|
npm publish
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# changelog
|
|
||||||
vant-cli changelog
|
|
||||||
fi
|
fi
|
||||||
|
1
dist/action-sheet/index.d.ts
vendored
Normal file
1
dist/action-sheet/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
5
dist/action-sheet/index.js
vendored
5
dist/action-sheet/index.js
vendored
@ -1,6 +1,7 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
import { button } from '../mixins/button';
|
import { button } from '../mixins/button';
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
classes: ['list-class'],
|
||||||
mixins: [button],
|
mixins: [button],
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
@ -35,6 +36,10 @@ VantComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
rootPortal: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSelect(event) {
|
onSelect(event) {
|
||||||
|
5
dist/action-sheet/index.wxml
vendored
5
dist/action-sheet/index.wxml
vendored
@ -6,9 +6,10 @@
|
|||||||
round="{{ round }}"
|
round="{{ round }}"
|
||||||
z-index="{{ zIndex }}"
|
z-index="{{ zIndex }}"
|
||||||
overlay="{{ overlay }}"
|
overlay="{{ overlay }}"
|
||||||
custom-class="van-action-sheet"
|
custom-class="van-action-sheet custom-class"
|
||||||
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
|
root-portal="{{ rootPortal }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
>
|
>
|
||||||
<view wx:if="{{ title }}" class="van-action-sheet__header">
|
<view wx:if="{{ title }}" class="van-action-sheet__header">
|
||||||
@ -22,7 +23,7 @@
|
|||||||
<view wx:if="{{ description }}" class="van-action-sheet__description van-hairline--bottom">
|
<view wx:if="{{ description }}" class="van-action-sheet__description van-hairline--bottom">
|
||||||
{{ description }}
|
{{ description }}
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{ actions && actions.length }}">
|
<view wx:if="{{ actions && actions.length }}" class="list-class">
|
||||||
<!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
|
<!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
|
||||||
<button
|
<button
|
||||||
wx:for="{{ actions }}"
|
wx:for="{{ actions }}"
|
||||||
|
1
dist/area/index.d.ts
vendored
Normal file
1
dist/area/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
5
dist/area/index.js
vendored
5
dist/area/index.js
vendored
@ -4,7 +4,10 @@ import { requestAnimationFrame } from '../common/utils';
|
|||||||
const EMPTY_CODE = '000000';
|
const EMPTY_CODE = '000000';
|
||||||
VantComponent({
|
VantComponent({
|
||||||
classes: ['active-class', 'toolbar-class', 'column-class'],
|
classes: ['active-class', 'toolbar-class', 'column-class'],
|
||||||
props: Object.assign(Object.assign({}, pickerProps), { value: {
|
props: Object.assign(Object.assign({}, pickerProps), { showToolbar: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
}, value: {
|
||||||
type: String,
|
type: String,
|
||||||
observer(value) {
|
observer(value) {
|
||||||
this.code = value;
|
this.code = value;
|
||||||
|
2
dist/area/index.wxml
vendored
2
dist/area/index.wxml
vendored
@ -5,7 +5,7 @@
|
|||||||
active-class="active-class"
|
active-class="active-class"
|
||||||
toolbar-class="toolbar-class"
|
toolbar-class="toolbar-class"
|
||||||
column-class="column-class"
|
column-class="column-class"
|
||||||
show-toolbar
|
show-toolbar="{{ showToolbar }}"
|
||||||
value-key="name"
|
value-key="name"
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
loading="{{ loading }}"
|
loading="{{ loading }}"
|
||||||
|
1
dist/button/index.d.ts
vendored
Normal file
1
dist/button/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
7
dist/button/index.wxml
vendored
7
dist/button/index.wxml
vendored
@ -2,10 +2,10 @@
|
|||||||
<wxs src="./index.wxs" module="computed" />
|
<wxs src="./index.wxs" module="computed" />
|
||||||
|
|
||||||
<button
|
<button
|
||||||
id="{{ id }}"
|
id="{{ id || buttonId }}"
|
||||||
data-detail="{{ dataset }}"
|
data-detail="{{ dataset }}"
|
||||||
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
|
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
|
||||||
hover-class="van-button--active hover-class"
|
hover-class="{{ disabled || loading ? '' : 'van-button--active hover-class'}}"
|
||||||
lang="{{ lang }}"
|
lang="{{ lang }}"
|
||||||
form-type="{{ formType }}"
|
form-type="{{ formType }}"
|
||||||
style="{{ computed.rootStyle({ plain, color, customStyle }) }}"
|
style="{{ computed.rootStyle({ plain, color, customStyle }) }}"
|
||||||
@ -22,9 +22,12 @@
|
|||||||
bindgetuserinfo="onGetUserInfo"
|
bindgetuserinfo="onGetUserInfo"
|
||||||
bindcontact="onContact"
|
bindcontact="onContact"
|
||||||
bindgetphonenumber="onGetPhoneNumber"
|
bindgetphonenumber="onGetPhoneNumber"
|
||||||
|
bindgetrealtimephonenumber="onGetRealTimePhoneNumber"
|
||||||
|
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
|
||||||
binderror="onError"
|
binderror="onError"
|
||||||
bindlaunchapp="onLaunchApp"
|
bindlaunchapp="onLaunchApp"
|
||||||
bindopensetting="onOpenSetting"
|
bindopensetting="onOpenSetting"
|
||||||
|
bindchooseavatar="onChooseAvatar"
|
||||||
>
|
>
|
||||||
<block wx:if="{{ loading }}">
|
<block wx:if="{{ loading }}">
|
||||||
<van-loading
|
<van-loading
|
||||||
|
6
dist/calendar/calendar.wxml
vendored
6
dist/calendar/calendar.wxml
vendored
@ -1,3 +1,5 @@
|
|||||||
|
<wxs src="./index.wxs" module="computed" />
|
||||||
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
<view class="van-calendar">
|
<view class="van-calendar">
|
||||||
<header
|
<header
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
@ -54,12 +56,12 @@
|
|||||||
type="danger"
|
type="danger"
|
||||||
color="{{ color }}"
|
color="{{ color }}"
|
||||||
custom-class="van-calendar__confirm"
|
custom-class="van-calendar__confirm"
|
||||||
disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
|
disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}"
|
||||||
nativeType="text"
|
nativeType="text"
|
||||||
bind:click="onConfirm"
|
bind:click="onConfirm"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
computed.getButtonDisabled(type, currentDate)
|
computed.getButtonDisabled(type, currentDate, minRange)
|
||||||
? confirmDisabledText
|
? confirmDisabledText
|
||||||
: confirmText
|
: confirmText
|
||||||
}}
|
}}
|
||||||
|
1
dist/calendar/components/header/index.d.ts
vendored
Normal file
1
dist/calendar/components/header/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
6
dist/calendar/components/month/index.d.ts
vendored
Normal file
6
dist/calendar/components/month/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export interface Day {
|
||||||
|
date: Date;
|
||||||
|
type: string;
|
||||||
|
text: number;
|
||||||
|
bottomInfo?: string;
|
||||||
|
}
|
2
dist/calendar/components/month/index.wxml
vendored
2
dist/calendar/components/month/index.wxml
vendored
@ -19,7 +19,7 @@
|
|||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
bindtap="onClick"
|
bindtap="onClick"
|
||||||
>
|
>
|
||||||
<view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="background: {{ color }}">
|
<view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="width: {{ rowHeight }}px; height: {{ rowHeight }}px; background: {{ color }}">
|
||||||
<view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
|
<view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
<view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
|
<view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
|
||||||
|
1
dist/calendar/index.d.ts
vendored
Normal file
1
dist/calendar/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
33
dist/calendar/index.js
vendored
33
dist/calendar/index.js
vendored
@ -40,6 +40,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
defaultDate: {
|
defaultDate: {
|
||||||
type: null,
|
type: null,
|
||||||
|
value: getToday().getTime(),
|
||||||
observer(val) {
|
observer(val) {
|
||||||
this.setData({ currentDate: val });
|
this.setData({ currentDate: val });
|
||||||
this.scrollIntoView();
|
this.scrollIntoView();
|
||||||
@ -103,17 +104,33 @@ VantComponent({
|
|||||||
type: null,
|
type: null,
|
||||||
value: null,
|
value: null,
|
||||||
},
|
},
|
||||||
|
minRange: {
|
||||||
|
type: Number,
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
firstDayOfWeek: {
|
firstDayOfWeek: {
|
||||||
type: Number,
|
type: Number,
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
readonly: Boolean,
|
readonly: Boolean,
|
||||||
|
rootPortal: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
currentDate: null,
|
currentDate: null,
|
||||||
scrollIntoView: '',
|
scrollIntoView: '',
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
minDate() {
|
||||||
|
this.initRect();
|
||||||
|
},
|
||||||
|
maxDate() {
|
||||||
|
this.initRect();
|
||||||
|
},
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentDate: this.getInitialDate(this.data.defaultDate),
|
currentDate: this.getInitialDate(this.data.defaultDate),
|
||||||
@ -127,7 +144,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
reset() {
|
reset() {
|
||||||
this.setData({ currentDate: this.getInitialDate() });
|
this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
|
||||||
this.scrollIntoView();
|
this.scrollIntoView();
|
||||||
},
|
},
|
||||||
initRect() {
|
initRect() {
|
||||||
@ -159,15 +176,19 @@ VantComponent({
|
|||||||
return date;
|
return date;
|
||||||
},
|
},
|
||||||
getInitialDate(defaultDate = null) {
|
getInitialDate(defaultDate = null) {
|
||||||
const { type, minDate, maxDate } = this.data;
|
const { type, minDate, maxDate, allowSameDay } = this.data;
|
||||||
|
if (!defaultDate)
|
||||||
|
return [];
|
||||||
const now = getToday().getTime();
|
const now = getToday().getTime();
|
||||||
if (type === 'range') {
|
if (type === 'range') {
|
||||||
if (!Array.isArray(defaultDate)) {
|
if (!Array.isArray(defaultDate)) {
|
||||||
defaultDate = [];
|
defaultDate = [];
|
||||||
}
|
}
|
||||||
const [startDay, endDay] = defaultDate || [];
|
const [startDay, endDay] = defaultDate || [];
|
||||||
const start = this.limitDateRange(startDay || now, minDate, getPrevDay(new Date(maxDate)).getTime());
|
const startDate = getTime(startDay || now);
|
||||||
const end = this.limitDateRange(endDay || now, getNextDay(new Date(minDate)).getTime());
|
const start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : getPrevDay(new Date(maxDate)).getTime());
|
||||||
|
const date = getTime(endDay || now);
|
||||||
|
const end = this.limitDateRange(date, allowSameDay ? date : getNextDay(new Date(minDate)).getTime());
|
||||||
return [start, end];
|
return [start, end];
|
||||||
}
|
}
|
||||||
if (type === 'multiple') {
|
if (type === 'multiple') {
|
||||||
@ -184,6 +205,8 @@ VantComponent({
|
|||||||
scrollIntoView() {
|
scrollIntoView() {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
const { currentDate, type, show, poppable, minDate, maxDate } = this.data;
|
const { currentDate, type, show, poppable, minDate, maxDate } = this.data;
|
||||||
|
if (!currentDate)
|
||||||
|
return;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const targetDate = type === 'single' ? currentDate : currentDate[0];
|
const targetDate = type === 'single' ? currentDate : currentDate[0];
|
||||||
const displayed = show || !poppable;
|
const displayed = show || !poppable;
|
||||||
@ -240,7 +263,7 @@ VantComponent({
|
|||||||
this.select([date, null]);
|
this.select([date, null]);
|
||||||
}
|
}
|
||||||
else if (allowSameDay) {
|
else if (allowSameDay) {
|
||||||
this.select([date, date]);
|
this.select([date, date], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
2
dist/calendar/index.wxml
vendored
2
dist/calendar/index.wxml
vendored
@ -12,6 +12,8 @@
|
|||||||
position="{{ position }}"
|
position="{{ position }}"
|
||||||
closeable="{{ showTitle || showSubtitle }}"
|
closeable="{{ showTitle || showSubtitle }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
||||||
|
root-portal="{{ rootPortal }}"
|
||||||
bind:enter="onOpen"
|
bind:enter="onOpen"
|
||||||
bind:close="onClose"
|
bind:close="onClose"
|
||||||
bind:after-enter="onOpened"
|
bind:after-enter="onOpened"
|
||||||
|
5
dist/calendar/index.wxs
vendored
5
dist/calendar/index.wxs
vendored
@ -6,7 +6,6 @@ function getMonths(minDate, maxDate) {
|
|||||||
var cursor = getDate(minDate);
|
var cursor = getDate(minDate);
|
||||||
|
|
||||||
cursor.setDate(1);
|
cursor.setDate(1);
|
||||||
cursor.setMinutes(cursor.getMinutes() - cursor.getTimezoneOffset());
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
months.push(cursor.getTime());
|
months.push(cursor.getTime());
|
||||||
@ -16,7 +15,7 @@ function getMonths(minDate, maxDate) {
|
|||||||
return months;
|
return months;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getButtonDisabled(type, currentDate) {
|
function getButtonDisabled(type, currentDate, minRange) {
|
||||||
if (currentDate == null) {
|
if (currentDate == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -26,7 +25,7 @@ function getButtonDisabled(type, currentDate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'multiple') {
|
if (type === 'multiple') {
|
||||||
return !currentDate.length;
|
return currentDate.length < minRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !currentDate;
|
return !currentDate;
|
||||||
|
2
dist/calendar/index.wxss
vendored
2
dist/calendar/index.wxss
vendored
@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
|
@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important}
|
12
dist/calendar/utils.d.ts
vendored
Normal file
12
dist/calendar/utils.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
export declare const ROW_HEIGHT = 64;
|
||||||
|
export declare function formatMonthTitle(date: Date): string;
|
||||||
|
export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
|
||||||
|
export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
|
||||||
|
export declare function getDayByOffset(date: Date, offset: number): Date;
|
||||||
|
export declare function getPrevDay(date: Date): Date;
|
||||||
|
export declare function getNextDay(date: Date): Date;
|
||||||
|
export declare function getToday(): Date;
|
||||||
|
export declare function calcDateNum(date: [Date, Date]): number;
|
||||||
|
export declare function copyDates(dates: Date | Date[]): Date | Date[];
|
||||||
|
export declare function getMonthEndDay(year: number, month: number): number;
|
||||||
|
export declare function getMonths(minDate: number, maxDate: number): number[];
|
1
dist/card/index.d.ts
vendored
Normal file
1
dist/card/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/cascader/index.d.ts
vendored
Normal file
1
dist/cascader/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
210
dist/cascader/index.js
vendored
Normal file
210
dist/cascader/index.js
vendored
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
import { VantComponent } from '../common/component';
|
||||||
|
var FieldName;
|
||||||
|
(function (FieldName) {
|
||||||
|
FieldName["TEXT"] = "text";
|
||||||
|
FieldName["VALUE"] = "value";
|
||||||
|
FieldName["CHILDREN"] = "children";
|
||||||
|
})(FieldName || (FieldName = {}));
|
||||||
|
const defaultFieldNames = {
|
||||||
|
text: FieldName.TEXT,
|
||||||
|
value: FieldName.VALUE,
|
||||||
|
children: FieldName.CHILDREN,
|
||||||
|
};
|
||||||
|
VantComponent({
|
||||||
|
props: {
|
||||||
|
title: String,
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
value: '请选择',
|
||||||
|
},
|
||||||
|
activeColor: {
|
||||||
|
type: String,
|
||||||
|
value: '#1989fa',
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
|
swipeable: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
closeable: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
showHeader: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
closeIcon: {
|
||||||
|
type: String,
|
||||||
|
value: 'cross',
|
||||||
|
},
|
||||||
|
fieldNames: {
|
||||||
|
type: Object,
|
||||||
|
value: defaultFieldNames,
|
||||||
|
observer: 'updateFieldNames',
|
||||||
|
},
|
||||||
|
useTitleSlot: Boolean,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
tabs: [],
|
||||||
|
activeTab: 0,
|
||||||
|
textKey: FieldName.TEXT,
|
||||||
|
valueKey: FieldName.VALUE,
|
||||||
|
childrenKey: FieldName.CHILDREN,
|
||||||
|
innerValue: '',
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
options() {
|
||||||
|
this.updateTabs();
|
||||||
|
},
|
||||||
|
value(newVal) {
|
||||||
|
this.updateValue(newVal);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.updateTabs();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
updateValue(val) {
|
||||||
|
if (val !== undefined) {
|
||||||
|
const values = this.data.tabs.map((tab) => tab.selected && tab.selected[this.data.valueKey]);
|
||||||
|
if (values.indexOf(val) > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.innerValue = val;
|
||||||
|
this.updateTabs();
|
||||||
|
},
|
||||||
|
updateFieldNames() {
|
||||||
|
const { text = 'text', value = 'value', children = 'children', } = this.data.fieldNames || defaultFieldNames;
|
||||||
|
this.setData({
|
||||||
|
textKey: text,
|
||||||
|
valueKey: value,
|
||||||
|
childrenKey: children,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getSelectedOptionsByValue(options, value) {
|
||||||
|
for (let i = 0; i < options.length; i++) {
|
||||||
|
const option = options[i];
|
||||||
|
if (option[this.data.valueKey] === value) {
|
||||||
|
return [option];
|
||||||
|
}
|
||||||
|
if (option[this.data.childrenKey]) {
|
||||||
|
const selectedOptions = this.getSelectedOptionsByValue(option[this.data.childrenKey], value);
|
||||||
|
if (selectedOptions) {
|
||||||
|
return [option, ...selectedOptions];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateTabs() {
|
||||||
|
const { options } = this.data;
|
||||||
|
const { innerValue } = this;
|
||||||
|
if (!options.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (innerValue !== undefined) {
|
||||||
|
const selectedOptions = this.getSelectedOptionsByValue(options, innerValue);
|
||||||
|
if (selectedOptions) {
|
||||||
|
let optionsCursor = options;
|
||||||
|
const tabs = selectedOptions.map((option) => {
|
||||||
|
const tab = {
|
||||||
|
options: optionsCursor,
|
||||||
|
selected: option,
|
||||||
|
};
|
||||||
|
const next = optionsCursor.find((item) => item[this.data.valueKey] === option[this.data.valueKey]);
|
||||||
|
if (next) {
|
||||||
|
optionsCursor = next[this.data.childrenKey];
|
||||||
|
}
|
||||||
|
return tab;
|
||||||
|
});
|
||||||
|
if (optionsCursor) {
|
||||||
|
tabs.push({
|
||||||
|
options: optionsCursor,
|
||||||
|
selected: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
tabs,
|
||||||
|
});
|
||||||
|
wx.nextTick(() => {
|
||||||
|
this.setData({
|
||||||
|
activeTab: tabs.length - 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
options,
|
||||||
|
selected: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
activeTab: 0,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.$emit('close');
|
||||||
|
},
|
||||||
|
onClickTab(e) {
|
||||||
|
const { index: tabIndex, title } = e.detail;
|
||||||
|
this.$emit('click-tab', { title, tabIndex });
|
||||||
|
this.setData({
|
||||||
|
activeTab: tabIndex,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 选中
|
||||||
|
onSelect(e) {
|
||||||
|
const { option, tabIndex } = e.currentTarget.dataset;
|
||||||
|
if (option && option.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { valueKey, childrenKey } = this.data;
|
||||||
|
let { tabs } = this.data;
|
||||||
|
tabs[tabIndex].selected = option;
|
||||||
|
if (tabs.length > tabIndex + 1) {
|
||||||
|
tabs = tabs.slice(0, tabIndex + 1);
|
||||||
|
}
|
||||||
|
if (option[childrenKey]) {
|
||||||
|
const nextTab = {
|
||||||
|
options: option[childrenKey],
|
||||||
|
selected: null,
|
||||||
|
};
|
||||||
|
if (tabs[tabIndex + 1]) {
|
||||||
|
tabs[tabIndex + 1] = nextTab;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tabs.push(nextTab);
|
||||||
|
}
|
||||||
|
wx.nextTick(() => {
|
||||||
|
this.setData({
|
||||||
|
activeTab: tabIndex + 1,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
tabs,
|
||||||
|
});
|
||||||
|
const selectedOptions = tabs.map((tab) => tab.selected).filter(Boolean);
|
||||||
|
const value = option[valueKey];
|
||||||
|
const params = {
|
||||||
|
value,
|
||||||
|
tabIndex,
|
||||||
|
selectedOptions,
|
||||||
|
};
|
||||||
|
this.innerValue = value;
|
||||||
|
this.$emit('change', params);
|
||||||
|
if (!option[childrenKey]) {
|
||||||
|
this.$emit('finish', params);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
8
dist/cascader/index.json
vendored
Normal file
8
dist/cascader/index.json
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-icon": "../icon/index",
|
||||||
|
"van-tab": "../tab/index",
|
||||||
|
"van-tabs": "../tabs/index"
|
||||||
|
}
|
||||||
|
}
|
54
dist/cascader/index.wxml
vendored
Normal file
54
dist/cascader/index.wxml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<wxs src="./index.wxs" module="utils" />
|
||||||
|
|
||||||
|
<view wx:if="{{ showHeader }}" class="van-cascader__header">
|
||||||
|
<slot name="title" wx:if="{{ useTitleSlot }}"></slot>
|
||||||
|
<text class="van-cascader__title" wx:else>{{ title }}</text>
|
||||||
|
<van-icon
|
||||||
|
wx:if="{{ closeable }}"
|
||||||
|
name="{{ closeIcon }}"
|
||||||
|
class="van-cascader__close-icon"
|
||||||
|
bind:tap="onClose"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-tabs
|
||||||
|
active="{{ activeTab }}"
|
||||||
|
custom-class="van-cascader__tabs"
|
||||||
|
wrap-class="van-cascader__tabs-wrap"
|
||||||
|
tab-class="van-cascader__tab"
|
||||||
|
color="{{ activeColor }}"
|
||||||
|
border="{{ false }}"
|
||||||
|
swipeable="{{ swipeable }}"
|
||||||
|
bind:click="onClickTab"
|
||||||
|
>
|
||||||
|
<van-tab
|
||||||
|
wx:for="{{ tabs }}"
|
||||||
|
wx:for-item="tab"
|
||||||
|
wx:for-index="tabIndex"
|
||||||
|
wx:key="tabIndex"
|
||||||
|
title="{{ tab.selected ? tab.selected[textKey] : placeholder }}"
|
||||||
|
style="width: 100%;"
|
||||||
|
title-style="{{ !tab.selected ? 'color: #969799;font-weight:normal;' : '' }}"
|
||||||
|
>
|
||||||
|
<!-- 暂不支持 -->
|
||||||
|
<!-- <slot name="options-top"></slot> -->
|
||||||
|
|
||||||
|
<view class="van-cascader__options">
|
||||||
|
<view
|
||||||
|
wx:for="{{ tab.options }}"
|
||||||
|
wx:for-item="option"
|
||||||
|
wx:key="index"
|
||||||
|
class="{{ option.className }} {{ utils.optionClass(tab, valueKey, option) }}"
|
||||||
|
style="{{ utils.optionStyle({ tab, valueKey, option, activeColor }) }}"
|
||||||
|
data-option="{{ option }}"
|
||||||
|
data-tab-index="{{ tabIndex }}"
|
||||||
|
bind:tap="onSelect"
|
||||||
|
>
|
||||||
|
<text>{{ option[textKey] }}</text>
|
||||||
|
<van-icon wx:if="{{ utils.isSelected(tab, valueKey, option) }}" name="success" size="18" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 暂不支持 -->
|
||||||
|
<!-- <slot name="options-bottom"></slot> -->
|
||||||
|
</van-tab>
|
||||||
|
</van-tabs>
|
24
dist/cascader/index.wxs
vendored
Normal file
24
dist/cascader/index.wxs
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
var utils = require('../wxs/utils.wxs');
|
||||||
|
var style = require('../wxs/style.wxs');
|
||||||
|
|
||||||
|
function isSelected(tab, valueKey, option) {
|
||||||
|
return tab.selected && tab.selected[valueKey] === option[valueKey]
|
||||||
|
}
|
||||||
|
|
||||||
|
function optionClass(tab, valueKey, option) {
|
||||||
|
return utils.bem('cascader__option', { selected: isSelected(tab, valueKey, option), disabled: option.disabled })
|
||||||
|
}
|
||||||
|
|
||||||
|
function optionStyle(data) {
|
||||||
|
var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined);
|
||||||
|
return style({
|
||||||
|
color
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
isSelected: isSelected,
|
||||||
|
optionClass: optionClass,
|
||||||
|
optionStyle: optionStyle,
|
||||||
|
};
|
1
dist/cascader/index.wxss
vendored
Normal file
1
dist/cascader/index.wxss
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
@import '../common/index.wxss';.van-cascader__header{align-items:center;display:flex;height:48px;justify-content:space-between;padding:0 16px}.van-cascader__title{font-size:16px;font-weight:600;line-height:20px}.van-cascader__close-icon{color:#c8c9cc;font-size:22px;height:22px}.van-cascader__tabs-wrap{height:48px!important;padding:0 8px}.van-cascader__tab{color:#323233!important;flex:none!important;font-weight:600!important;padding:0 8px!important}.van-cascader__tab--unselected{color:#969799!important;font-weight:400!important}.van-cascader__option{align-items:center;cursor:pointer;display:flex;font-size:14px;justify-content:space-between;line-height:20px;padding:10px 16px}.van-cascader__option:active{background-color:#f2f3f5}.van-cascader__option--selected{color:#1989fa;font-weight:600}.van-cascader__option--disabled{color:#c8c9cc;cursor:not-allowed}.van-cascader__option--disabled:active{background-color:initial}.van-cascader__options{-webkit-overflow-scrolling:touch;box-sizing:border-box;height:384px;overflow-y:auto;padding-top:6px}
|
1
dist/cell-group/index.d.ts
vendored
Normal file
1
dist/cell-group/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/cell/index.d.ts
vendored
Normal file
1
dist/cell/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/checkbox-group/index.d.ts
vendored
Normal file
1
dist/checkbox-group/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/checkbox/index.d.ts
vendored
Normal file
1
dist/checkbox/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
4
dist/circle/canvas.d.ts
vendored
Normal file
4
dist/circle/canvas.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
type CanvasContext = WechatMiniprogram.CanvasContext;
|
||||||
|
export declare function adaptor(ctx: CanvasContext & Record<string, unknown>): CanvasContext;
|
||||||
|
export {};
|
1
dist/circle/index.d.ts
vendored
Normal file
1
dist/circle/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
4
dist/circle/index.js
vendored
4
dist/circle/index.js
vendored
@ -93,6 +93,8 @@ VantComponent({
|
|||||||
const { color, size } = this.data;
|
const { color, size } = this.data;
|
||||||
if (isObj(color)) {
|
if (isObj(color)) {
|
||||||
return this.getContext().then((context) => {
|
return this.getContext().then((context) => {
|
||||||
|
if (!context)
|
||||||
|
return;
|
||||||
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
|
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
|
||||||
Object.keys(color)
|
Object.keys(color)
|
||||||
.sort((a, b) => parseFloat(a) - parseFloat(b))
|
.sort((a, b) => parseFloat(a) - parseFloat(b))
|
||||||
@ -134,6 +136,8 @@ VantComponent({
|
|||||||
drawCircle(currentValue) {
|
drawCircle(currentValue) {
|
||||||
const { size } = this.data;
|
const { size } = this.data;
|
||||||
this.getContext().then((context) => {
|
this.getContext().then((context) => {
|
||||||
|
if (!context)
|
||||||
|
return;
|
||||||
context.clearRect(0, 0, size, size);
|
context.clearRect(0, 0, size, size);
|
||||||
this.renderLayerCircle(context);
|
this.renderLayerCircle(context);
|
||||||
const formatValue = format(currentValue);
|
const formatValue = format(currentValue);
|
||||||
|
1
dist/col/index.d.ts
vendored
Normal file
1
dist/col/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
2
dist/collapse-item/animate.d.ts
vendored
Normal file
2
dist/collapse-item/animate.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
export declare function setContentAnimate(context: WechatMiniprogram.Component.TrivialInstance, expanded: boolean, mounted: boolean): void;
|
1
dist/collapse-item/index.d.ts
vendored
Normal file
1
dist/collapse-item/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/collapse-item/index.js
vendored
1
dist/collapse-item/index.js
vendored
@ -5,6 +5,7 @@ VantComponent({
|
|||||||
classes: ['title-class', 'content-class'],
|
classes: ['title-class', 'content-class'],
|
||||||
relation: useParent('collapse'),
|
relation: useParent('collapse'),
|
||||||
props: {
|
props: {
|
||||||
|
size: String,
|
||||||
name: null,
|
name: null,
|
||||||
title: null,
|
title: null,
|
||||||
value: null,
|
value: null,
|
||||||
|
1
dist/collapse-item/index.wxml
vendored
1
dist/collapse-item/index.wxml
vendored
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
||||||
<van-cell
|
<van-cell
|
||||||
|
size="{{ size }}"
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
title-class="title-class"
|
title-class="title-class"
|
||||||
icon="{{ icon }}"
|
icon="{{ icon }}"
|
||||||
|
1
dist/collapse/index.d.ts
vendored
Normal file
1
dist/collapse/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
7
dist/common/color.d.ts
vendored
Normal file
7
dist/common/color.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export declare const RED = "#ee0a24";
|
||||||
|
export declare const BLUE = "#1989fa";
|
||||||
|
export declare const WHITE = "#fff";
|
||||||
|
export declare const GREEN = "#07c160";
|
||||||
|
export declare const ORANGE = "#ff976a";
|
||||||
|
export declare const GRAY = "#323233";
|
||||||
|
export declare const GRAY_DARK = "#969799";
|
4
dist/common/component.d.ts
vendored
Normal file
4
dist/common/component.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
import { VantComponentOptions } from 'definitions/index';
|
||||||
|
declare function VantComponent<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption>(vantOptions: VantComponentOptions<Data, Props, Methods>): void;
|
||||||
|
export { VantComponent };
|
1
dist/common/component.js
vendored
1
dist/common/component.js
vendored
@ -11,6 +11,7 @@ function VantComponent(vantOptions) {
|
|||||||
mapKeys(vantOptions, options, {
|
mapKeys(vantOptions, options, {
|
||||||
data: 'data',
|
data: 'data',
|
||||||
props: 'properties',
|
props: 'properties',
|
||||||
|
watch: 'observers',
|
||||||
mixins: 'behaviors',
|
mixins: 'behaviors',
|
||||||
methods: 'methods',
|
methods: 'methods',
|
||||||
beforeCreate: 'created',
|
beforeCreate: 'created',
|
||||||
|
15
dist/common/relation.d.ts
vendored
Normal file
15
dist/common/relation.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
|
||||||
|
export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): {
|
||||||
|
relations: {
|
||||||
|
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||||
|
};
|
||||||
|
mixin: string;
|
||||||
|
};
|
||||||
|
export declare function useChildren(name: string, onEffect?: (this: TrivialInstance, target: TrivialInstance) => void): {
|
||||||
|
relations: {
|
||||||
|
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||||
|
};
|
||||||
|
mixin: string;
|
||||||
|
};
|
||||||
|
export {};
|
21
dist/common/utils.d.ts
vendored
Normal file
21
dist/common/utils.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
export { isDef } from './validator';
|
||||||
|
export { getSystemInfoSync } from './version';
|
||||||
|
export declare function range(num: number, min: number, max: number): number;
|
||||||
|
export declare function nextTick(cb: (...args: any[]) => void): void;
|
||||||
|
export declare function addUnit(value?: string | number): string | undefined;
|
||||||
|
export declare function requestAnimationFrame(cb: () => void): NodeJS.Timeout;
|
||||||
|
export declare function pickExclude(obj: unknown, keys: string[]): {};
|
||||||
|
export declare function getRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
|
||||||
|
export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
|
||||||
|
export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void;
|
||||||
|
export declare function toPromise(promiseLike: Promise<unknown> | unknown): Promise<unknown>;
|
||||||
|
export declare function addNumber(num1: any, num2: any): number;
|
||||||
|
export declare const clamp: (num: any, min: any, max: any) => number;
|
||||||
|
export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> & WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> & WechatMiniprogram.IAnyObject;
|
||||||
|
export declare const isPC: boolean;
|
||||||
|
export declare const isWxWork: boolean;
|
34
dist/common/utils.js
vendored
34
dist/common/utils.js
vendored
@ -1,6 +1,7 @@
|
|||||||
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
||||||
import { canIUseGroupSetData, canIUseNextTick } from './version';
|
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync, } from './version';
|
||||||
export { isDef } from './validator';
|
export { isDef } from './validator';
|
||||||
|
export { getSystemInfoSync } from './version';
|
||||||
export function range(num, min, max) {
|
export function range(num, min, max) {
|
||||||
return Math.min(Math.max(num, min), max);
|
return Math.min(Math.max(num, min), max);
|
||||||
}
|
}
|
||||||
@ -14,13 +15,6 @@ export function nextTick(cb) {
|
|||||||
}, 1000 / 30);
|
}, 1000 / 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let systemInfo;
|
|
||||||
export function getSystemInfoSync() {
|
|
||||||
if (systemInfo == null) {
|
|
||||||
systemInfo = wx.getSystemInfoSync();
|
|
||||||
}
|
|
||||||
return systemInfo;
|
|
||||||
}
|
|
||||||
export function addUnit(value) {
|
export function addUnit(value) {
|
||||||
if (!isDef(value)) {
|
if (!isDef(value)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
@ -29,19 +23,9 @@ export function addUnit(value) {
|
|||||||
return isNumber(value) ? `${value}px` : value;
|
return isNumber(value) ? `${value}px` : value;
|
||||||
}
|
}
|
||||||
export function requestAnimationFrame(cb) {
|
export function requestAnimationFrame(cb) {
|
||||||
const systemInfo = getSystemInfoSync();
|
return setTimeout(() => {
|
||||||
if (systemInfo.platform === 'devtools') {
|
|
||||||
return setTimeout(() => {
|
|
||||||
cb();
|
|
||||||
}, 1000 / 30);
|
|
||||||
}
|
|
||||||
return wx
|
|
||||||
.createSelectorQuery()
|
|
||||||
.selectViewport()
|
|
||||||
.boundingClientRect()
|
|
||||||
.exec(() => {
|
|
||||||
cb();
|
cb();
|
||||||
});
|
}, 1000 / 30);
|
||||||
}
|
}
|
||||||
export function pickExclude(obj, keys) {
|
export function pickExclude(obj, keys) {
|
||||||
if (!isPlainObject(obj)) {
|
if (!isPlainObject(obj)) {
|
||||||
@ -86,7 +70,17 @@ export function toPromise(promiseLike) {
|
|||||||
}
|
}
|
||||||
return Promise.resolve(promiseLike);
|
return Promise.resolve(promiseLike);
|
||||||
}
|
}
|
||||||
|
// 浮点数精度处理
|
||||||
|
export function addNumber(num1, num2) {
|
||||||
|
const cardinal = Math.pow(10, 10);
|
||||||
|
return Math.round((num1 + num2) * cardinal) / cardinal;
|
||||||
|
}
|
||||||
|
// 限制value在[min, max]之间
|
||||||
|
export const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||||
export function getCurrentPage() {
|
export function getCurrentPage() {
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
return pages[pages.length - 1];
|
return pages[pages.length - 1];
|
||||||
}
|
}
|
||||||
|
export const isPC = ['mac', 'windows'].includes(getSystemInfoSync().platform);
|
||||||
|
// 是否企业微信
|
||||||
|
export const isWxWork = getSystemInfoSync().environment === 'wxwork';
|
||||||
|
9
dist/common/validator.d.ts
vendored
Normal file
9
dist/common/validator.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export declare function isFunction(val: unknown): val is Function;
|
||||||
|
export declare function isPlainObject(val: unknown): val is Record<string, unknown>;
|
||||||
|
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
|
||||||
|
export declare function isDef(value: unknown): boolean;
|
||||||
|
export declare function isObj(x: unknown): x is Record<string, unknown>;
|
||||||
|
export declare function isNumber(value: string): boolean;
|
||||||
|
export declare function isBoolean(value: unknown): value is boolean;
|
||||||
|
export declare function isImageUrl(url: string): boolean;
|
||||||
|
export declare function isVideoUrl(url: string): boolean;
|
15
dist/common/version.d.ts
vendored
Normal file
15
dist/common/version.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
interface WxWorkSystemInfo extends WechatMiniprogram.SystemInfo {
|
||||||
|
environment?: 'wxwork';
|
||||||
|
}
|
||||||
|
interface SystemInfo extends WxWorkSystemInfo, WechatMiniprogram.SystemInfo {
|
||||||
|
}
|
||||||
|
export declare function getSystemInfoSync(): SystemInfo;
|
||||||
|
export declare function canIUseModel(): boolean;
|
||||||
|
export declare function canIUseFormFieldButton(): boolean;
|
||||||
|
export declare function canIUseAnimate(): boolean;
|
||||||
|
export declare function canIUseGroupSetData(): boolean;
|
||||||
|
export declare function canIUseNextTick(): boolean;
|
||||||
|
export declare function canIUseCanvas2d(): boolean;
|
||||||
|
export declare function canIUseGetUserProfile(): boolean;
|
||||||
|
export {};
|
15
dist/common/version.js
vendored
15
dist/common/version.js
vendored
@ -1,4 +1,10 @@
|
|||||||
import { getSystemInfoSync } from './utils';
|
let systemInfo;
|
||||||
|
export function getSystemInfoSync() {
|
||||||
|
if (systemInfo == null) {
|
||||||
|
systemInfo = wx.getSystemInfoSync();
|
||||||
|
}
|
||||||
|
return systemInfo;
|
||||||
|
}
|
||||||
function compareVersion(v1, v2) {
|
function compareVersion(v1, v2) {
|
||||||
v1 = v1.split('.');
|
v1 = v1.split('.');
|
||||||
v2 = v2.split('.');
|
v2 = v2.split('.');
|
||||||
@ -38,7 +44,12 @@ export function canIUseGroupSetData() {
|
|||||||
return gte('2.4.0');
|
return gte('2.4.0');
|
||||||
}
|
}
|
||||||
export function canIUseNextTick() {
|
export function canIUseNextTick() {
|
||||||
return wx.canIUse('nextTick');
|
try {
|
||||||
|
return wx.canIUse('nextTick');
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
return gte('2.7.1');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export function canIUseCanvas2d() {
|
export function canIUseCanvas2d() {
|
||||||
return gte('2.9.0');
|
return gte('2.9.0');
|
||||||
|
1
dist/config-provider/index.d.ts
vendored
Normal file
1
dist/config-provider/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/count-down/index.d.ts
vendored
Normal file
1
dist/count-down/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
10
dist/count-down/utils.d.ts
vendored
Normal file
10
dist/count-down/utils.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export type TimeData = {
|
||||||
|
days: number;
|
||||||
|
hours: number;
|
||||||
|
minutes: number;
|
||||||
|
seconds: number;
|
||||||
|
milliseconds: number;
|
||||||
|
};
|
||||||
|
export declare function parseTimeData(time: number): TimeData;
|
||||||
|
export declare function parseFormat(format: string, timeData: TimeData): string;
|
||||||
|
export declare function isSameSecond(time1: number, time2: number): boolean;
|
1
dist/datetime-picker/index.d.ts
vendored
Normal file
1
dist/datetime-picker/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
29
dist/definitions/index.d.ts
vendored
Normal file
29
dist/definitions/index.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
interface VantComponentInstance {
|
||||||
|
parent: WechatMiniprogram.Component.TrivialInstance;
|
||||||
|
children: WechatMiniprogram.Component.TrivialInstance[];
|
||||||
|
index: number;
|
||||||
|
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
||||||
|
setView: (value: Record<string, any>, callback?: () => void) => void;
|
||||||
|
}
|
||||||
|
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
||||||
|
data?: Data;
|
||||||
|
field?: boolean;
|
||||||
|
classes?: string[];
|
||||||
|
mixins?: string[];
|
||||||
|
props?: Props;
|
||||||
|
relation?: {
|
||||||
|
relations: Record<string, WechatMiniprogram.Component.RelationOption>;
|
||||||
|
mixin: string;
|
||||||
|
};
|
||||||
|
watch?: Record<string, (...args: any[]) => any>;
|
||||||
|
methods?: Methods;
|
||||||
|
beforeCreate?: () => void;
|
||||||
|
created?: () => void;
|
||||||
|
mounted?: () => void;
|
||||||
|
destroyed?: () => void;
|
||||||
|
} & ThisType<VantComponentInstance & WechatMiniprogram.Component.Instance<Data & {
|
||||||
|
name: string;
|
||||||
|
value: any;
|
||||||
|
} & Record<string, any>, Props, Methods> & Record<string, any>>;
|
||||||
|
export {};
|
55
dist/dialog/dialog.d.ts
vendored
Normal file
55
dist/dialog/dialog.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
export type Action = 'confirm' | 'cancel' | 'overlay';
|
||||||
|
type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
|
||||||
|
interface DialogOptions {
|
||||||
|
lang?: string;
|
||||||
|
show?: boolean;
|
||||||
|
title?: string;
|
||||||
|
width?: string | number | null;
|
||||||
|
zIndex?: number;
|
||||||
|
theme?: string;
|
||||||
|
context?: (() => DialogContext) | DialogContext;
|
||||||
|
message?: string;
|
||||||
|
overlay?: boolean;
|
||||||
|
selector?: string;
|
||||||
|
ariaLabel?: string;
|
||||||
|
/**
|
||||||
|
* @deprecated use custom-class instead
|
||||||
|
*/
|
||||||
|
className?: string;
|
||||||
|
customStyle?: string;
|
||||||
|
transition?: string;
|
||||||
|
/**
|
||||||
|
* @deprecated use beforeClose instead
|
||||||
|
*/
|
||||||
|
asyncClose?: boolean;
|
||||||
|
beforeClose?: null | ((action: Action) => Promise<void | boolean> | void);
|
||||||
|
businessId?: number;
|
||||||
|
sessionFrom?: string;
|
||||||
|
overlayStyle?: string;
|
||||||
|
appParameter?: string;
|
||||||
|
messageAlign?: string;
|
||||||
|
sendMessageImg?: string;
|
||||||
|
showMessageCard?: boolean;
|
||||||
|
sendMessagePath?: string;
|
||||||
|
sendMessageTitle?: string;
|
||||||
|
confirmButtonText?: string;
|
||||||
|
cancelButtonText?: string;
|
||||||
|
showConfirmButton?: boolean;
|
||||||
|
showCancelButton?: boolean;
|
||||||
|
closeOnClickOverlay?: boolean;
|
||||||
|
confirmButtonOpenType?: string;
|
||||||
|
}
|
||||||
|
declare const Dialog: {
|
||||||
|
(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||||
|
alert(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||||
|
confirm(options: DialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
||||||
|
close(): void;
|
||||||
|
stopLoading(): void;
|
||||||
|
currentOptions: DialogOptions;
|
||||||
|
defaultOptions: DialogOptions;
|
||||||
|
setDefaultOptions(options: DialogOptions): void;
|
||||||
|
resetDefaultOptions(): void;
|
||||||
|
};
|
||||||
|
export default Dialog;
|
4
dist/dialog/dialog.js
vendored
4
dist/dialog/dialog.js
vendored
@ -30,7 +30,9 @@ function getContext() {
|
|||||||
const Dialog = (options) => {
|
const Dialog = (options) => {
|
||||||
options = Object.assign(Object.assign({}, currentOptions), options);
|
options = Object.assign(Object.assign({}, currentOptions), options);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const context = options.context || getContext();
|
const context = (typeof options.context === 'function'
|
||||||
|
? options.context()
|
||||||
|
: options.context) || getContext();
|
||||||
const dialog = context.selectComponent(options.selector);
|
const dialog = context.selectComponent(options.selector);
|
||||||
delete options.context;
|
delete options.context;
|
||||||
delete options.selector;
|
delete options.selector;
|
||||||
|
1
dist/dialog/index.d.ts
vendored
Normal file
1
dist/dialog/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
10
dist/dialog/index.js
vendored
10
dist/dialog/index.js
vendored
@ -4,6 +4,7 @@ import { GRAY, RED } from '../common/color';
|
|||||||
import { toPromise } from '../common/utils';
|
import { toPromise } from '../common/utils';
|
||||||
VantComponent({
|
VantComponent({
|
||||||
mixins: [button],
|
mixins: [button],
|
||||||
|
classes: ['cancle-button-class', 'confirm-button-class'],
|
||||||
props: {
|
props: {
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@ -17,14 +18,17 @@ VantComponent({
|
|||||||
type: String,
|
type: String,
|
||||||
value: 'default',
|
value: 'default',
|
||||||
},
|
},
|
||||||
useSlot: Boolean,
|
confirmButtonId: String,
|
||||||
className: String,
|
className: String,
|
||||||
customStyle: String,
|
customStyle: String,
|
||||||
asyncClose: Boolean,
|
asyncClose: Boolean,
|
||||||
messageAlign: String,
|
messageAlign: String,
|
||||||
beforeClose: null,
|
beforeClose: null,
|
||||||
overlayStyle: String,
|
overlayStyle: String,
|
||||||
|
useSlot: Boolean,
|
||||||
useTitleSlot: Boolean,
|
useTitleSlot: Boolean,
|
||||||
|
useConfirmButtonSlot: Boolean,
|
||||||
|
useCancelButtonSlot: Boolean,
|
||||||
showCancelButton: Boolean,
|
showCancelButton: Boolean,
|
||||||
closeOnClickOverlay: Boolean,
|
closeOnClickOverlay: Boolean,
|
||||||
confirmButtonOpenType: String,
|
confirmButtonOpenType: String,
|
||||||
@ -61,6 +65,10 @@ VantComponent({
|
|||||||
type: String,
|
type: String,
|
||||||
value: 'scale',
|
value: 'scale',
|
||||||
},
|
},
|
||||||
|
rootPortal: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
loading: {
|
loading: {
|
||||||
|
98
dist/dialog/index.wxml
vendored
98
dist/dialog/index.wxml
vendored
@ -5,10 +5,11 @@
|
|||||||
z-index="{{ zIndex }}"
|
z-index="{{ zIndex }}"
|
||||||
overlay="{{ overlay }}"
|
overlay="{{ overlay }}"
|
||||||
transition="{{ transition }}"
|
transition="{{ transition }}"
|
||||||
custom-class="van-dialog van-dialog--{{ theme }} {{ className }}"
|
custom-class="van-dialog van-dialog--{{ theme }}{{ className }} custom-class"
|
||||||
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
||||||
overlay-style="{{ overlayStyle }}"
|
overlay-style="{{ overlayStyle }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
|
root-portal="{{ rootPortal }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
@ -33,7 +34,7 @@
|
|||||||
size="large"
|
size="large"
|
||||||
loading="{{ loading.cancel }}"
|
loading="{{ loading.cancel }}"
|
||||||
class="van-dialog__button van-hairline--right"
|
class="van-dialog__button van-hairline--right"
|
||||||
custom-class="van-dialog__cancel"
|
custom-class="van-dialog__cancel cancle-button-class"
|
||||||
custom-style="color: {{ cancelButtonColor }}"
|
custom-style="color: {{ cancelButtonColor }}"
|
||||||
bind:click="onCancel"
|
bind:click="onCancel"
|
||||||
>
|
>
|
||||||
@ -44,9 +45,9 @@
|
|||||||
size="large"
|
size="large"
|
||||||
class="van-dialog__button"
|
class="van-dialog__button"
|
||||||
loading="{{ loading.confirm }}"
|
loading="{{ loading.confirm }}"
|
||||||
custom-class="van-dialog__confirm"
|
custom-class="van-dialog__confirm confirm-button-class"
|
||||||
custom-style="color: {{ confirmButtonColor }}"
|
custom-style="color: {{ confirmButtonColor }}"
|
||||||
|
button-id="{{ confirmButtonId }}"
|
||||||
open-type="{{ confirmButtonOpenType }}"
|
open-type="{{ confirmButtonOpenType }}"
|
||||||
lang="{{ lang }}"
|
lang="{{ lang }}"
|
||||||
business-id="{{ businessId }}"
|
business-id="{{ businessId }}"
|
||||||
@ -56,7 +57,8 @@
|
|||||||
send-message-img="{{ sendMessageImg }}"
|
send-message-img="{{ sendMessageImg }}"
|
||||||
show-message-card="{{ showMessageCard }}"
|
show-message-card="{{ showMessageCard }}"
|
||||||
app-parameter="{{ appParameter }}"
|
app-parameter="{{ appParameter }}"
|
||||||
|
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
|
||||||
|
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
|
||||||
bind:click="onConfirm"
|
bind:click="onConfirm"
|
||||||
bindgetuserinfo="onGetUserInfo"
|
bindgetuserinfo="onGetUserInfo"
|
||||||
bindcontact="onContact"
|
bindcontact="onContact"
|
||||||
@ -69,45 +71,55 @@
|
|||||||
</van-goods-action-button>
|
</van-goods-action-button>
|
||||||
</van-goods-action>
|
</van-goods-action>
|
||||||
|
|
||||||
<view wx:else class="van-hairline--top van-dialog__footer">
|
<view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
|
||||||
<van-button
|
<block wx:if="{{ showCancelButton }}">
|
||||||
wx:if="{{ showCancelButton }}"
|
<slot wx:if="{{ useCancelButtonSlot }}" name="cancel-button" />
|
||||||
size="large"
|
|
||||||
loading="{{ loading.cancel }}"
|
|
||||||
class="van-dialog__button van-hairline--right"
|
|
||||||
custom-class="van-dialog__cancel"
|
|
||||||
custom-style="color: {{ cancelButtonColor }}"
|
|
||||||
bind:click="onCancel"
|
|
||||||
>
|
|
||||||
{{ cancelButtonText }}
|
|
||||||
</van-button>
|
|
||||||
<van-button
|
|
||||||
wx:if="{{ showConfirmButton }}"
|
|
||||||
size="large"
|
|
||||||
class="van-dialog__button"
|
|
||||||
loading="{{ loading.confirm }}"
|
|
||||||
custom-class="van-dialog__confirm"
|
|
||||||
custom-style="color: {{ confirmButtonColor }}"
|
|
||||||
|
|
||||||
open-type="{{ confirmButtonOpenType }}"
|
<van-button
|
||||||
lang="{{ lang }}"
|
wx:else
|
||||||
business-id="{{ businessId }}"
|
size="large"
|
||||||
session-from="{{ sessionFrom }}"
|
loading="{{ loading.cancel }}"
|
||||||
send-message-title="{{ sendMessageTitle }}"
|
class="van-dialog__button van-hairline--right"
|
||||||
send-message-path="{{ sendMessagePath }}"
|
custom-class="van-dialog__cancel cancle-button-class"
|
||||||
send-message-img="{{ sendMessageImg }}"
|
custom-style="color: {{ cancelButtonColor }}"
|
||||||
show-message-card="{{ showMessageCard }}"
|
bind:click="onCancel"
|
||||||
app-parameter="{{ appParameter }}"
|
>
|
||||||
|
{{ cancelButtonText }}
|
||||||
|
</van-button>
|
||||||
|
</block>
|
||||||
|
|
||||||
bind:click="onConfirm"
|
<block wx:if="{{ showConfirmButton }}">
|
||||||
bindgetuserinfo="onGetUserInfo"
|
<slot wx:if="{{ useConfirmButtonSlot }}" name="confirm-button" />
|
||||||
bindcontact="onContact"
|
|
||||||
bindgetphonenumber="onGetPhoneNumber"
|
<van-button
|
||||||
binderror="onError"
|
wx:else
|
||||||
bindlaunchapp="onLaunchApp"
|
size="large"
|
||||||
bindopensetting="onOpenSetting"
|
class="van-dialog__button"
|
||||||
>
|
loading="{{ loading.confirm }}"
|
||||||
{{ confirmButtonText }}
|
custom-class="van-dialog__confirm confirm-button-class"
|
||||||
</van-button>
|
custom-style="color: {{ confirmButtonColor }}"
|
||||||
|
button-id="{{ confirmButtonId }}"
|
||||||
|
open-type="{{ confirmButtonOpenType }}"
|
||||||
|
lang="{{ lang }}"
|
||||||
|
business-id="{{ businessId }}"
|
||||||
|
session-from="{{ sessionFrom }}"
|
||||||
|
send-message-title="{{ sendMessageTitle }}"
|
||||||
|
send-message-path="{{ sendMessagePath }}"
|
||||||
|
send-message-img="{{ sendMessageImg }}"
|
||||||
|
show-message-card="{{ showMessageCard }}"
|
||||||
|
app-parameter="{{ appParameter }}"
|
||||||
|
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
|
||||||
|
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
|
||||||
|
bind:click="onConfirm"
|
||||||
|
bindgetuserinfo="onGetUserInfo"
|
||||||
|
bindcontact="onContact"
|
||||||
|
bindgetphonenumber="onGetPhoneNumber"
|
||||||
|
binderror="onError"
|
||||||
|
bindlaunchapp="onLaunchApp"
|
||||||
|
bindopensetting="onOpenSetting"
|
||||||
|
>
|
||||||
|
{{ confirmButtonText }}
|
||||||
|
</van-button>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
2
dist/dialog/index.wxss
vendored
2
dist/dialog/index.wxss
vendored
@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
@import '../common/index.wxss';.van-dialog{background-color:var(--dialog-background-color,#fff);border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,320px)}@media (max-width:321px){.van-dialog{width:var(--dialog-small-screen-width,90%)}}.van-dialog__header{font-weight:var(--dialog-header-font-weight,500);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.van-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.van-dialog__message{-webkit-overflow-scrolling:touch;font-size:var(--dialog-message-font-size,14px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.van-dialog__message-text{word-wrap:break-word}.van-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,#646566);padding-top:var(--dialog-has-title-message-padding-top,8px)}.van-dialog__message--round-button{color:#323233;padding-bottom:16px}.van-dialog__message--left{text-align:left}.van-dialog__message--right{text-align:right}.van-dialog__message--justify{text-align:justify}.van-dialog__footer{display:flex}.van-dialog__footer--round-button{padding:8px 24px 16px!important;position:relative!important}.van-dialog__button{flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
1
dist/divider/index.d.ts
vendored
Normal file
1
dist/divider/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/dropdown-item/index.d.ts
vendored
Normal file
1
dist/dropdown-item/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
54
dist/dropdown-item/index.js
vendored
54
dist/dropdown-item/index.js
vendored
@ -1,6 +1,7 @@
|
|||||||
import { useParent } from '../common/relation';
|
import { useParent } from '../common/relation';
|
||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
VantComponent({
|
VantComponent({
|
||||||
|
classes: ['item-title-class'],
|
||||||
field: true,
|
field: true,
|
||||||
relation: useParent('dropdown-menu', function () {
|
relation: useParent('dropdown-menu', function () {
|
||||||
this.updateDataFromParent();
|
this.updateDataFromParent();
|
||||||
@ -25,12 +26,21 @@ VantComponent({
|
|||||||
observer: 'rerender',
|
observer: 'rerender',
|
||||||
},
|
},
|
||||||
popupStyle: String,
|
popupStyle: String,
|
||||||
|
useBeforeToggle: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
rootPortal: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
transition: true,
|
transition: true,
|
||||||
showPopup: false,
|
showPopup: false,
|
||||||
showWrapper: false,
|
showWrapper: false,
|
||||||
displayTitle: '',
|
displayTitle: '',
|
||||||
|
safeAreaTabBar: false,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
rerender() {
|
rerender() {
|
||||||
@ -41,13 +51,14 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
updateDataFromParent() {
|
updateDataFromParent() {
|
||||||
if (this.parent) {
|
if (this.parent) {
|
||||||
const { overlay, duration, activeColor, closeOnClickOverlay, direction, } = this.parent.data;
|
const { overlay, duration, activeColor, closeOnClickOverlay, direction, safeAreaTabBar, } = this.parent.data;
|
||||||
this.setData({
|
this.setData({
|
||||||
overlay,
|
overlay,
|
||||||
duration,
|
duration,
|
||||||
activeColor,
|
activeColor,
|
||||||
closeOnClickOverlay,
|
closeOnClickOverlay,
|
||||||
direction,
|
direction,
|
||||||
|
safeAreaTabBar,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -76,7 +87,6 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggle(show, options = {}) {
|
toggle(show, options = {}) {
|
||||||
var _a;
|
|
||||||
const { showPopup } = this.data;
|
const { showPopup } = this.data;
|
||||||
if (typeof show !== 'boolean') {
|
if (typeof show !== 'boolean') {
|
||||||
show = !showPopup;
|
show = !showPopup;
|
||||||
@ -84,19 +94,37 @@ VantComponent({
|
|||||||
if (show === showPopup) {
|
if (show === showPopup) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setData({
|
this.onBeforeToggle(show).then((status) => {
|
||||||
transition: !options.immediate,
|
var _a;
|
||||||
showPopup: show,
|
if (!status) {
|
||||||
});
|
return;
|
||||||
if (show) {
|
}
|
||||||
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then((wrapperStyle) => {
|
this.setData({
|
||||||
this.setData({ wrapperStyle, showWrapper: true });
|
transition: !options.immediate,
|
||||||
this.rerender();
|
showPopup: show,
|
||||||
});
|
});
|
||||||
|
if (show) {
|
||||||
|
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.getChildWrapperStyle().then((wrapperStyle) => {
|
||||||
|
this.setData({ wrapperStyle, showWrapper: true });
|
||||||
|
this.rerender();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.rerender();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onBeforeToggle(status) {
|
||||||
|
const { useBeforeToggle } = this.data;
|
||||||
|
if (!useBeforeToggle) {
|
||||||
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
else {
|
return new Promise((resolve) => {
|
||||||
this.rerender();
|
this.$emit('before-toggle', {
|
||||||
}
|
status,
|
||||||
|
callback: (value) => resolve(value),
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
6
dist/dropdown-item/index.wxml
vendored
6
dist/dropdown-item/index.wxml
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<view
|
<view
|
||||||
wx:if="{{ showWrapper }}"
|
wx:if="{{ showWrapper }}"
|
||||||
class="{{ utils.bem('dropdown-item', direction) }}"
|
class="{{ utils.bem('dropdown-item', direction) }} custom-class"
|
||||||
style="{{ wrapperStyle }}"
|
style="{{ wrapperStyle }}"
|
||||||
>
|
>
|
||||||
<van-popup
|
<van-popup
|
||||||
@ -12,7 +12,9 @@
|
|||||||
overlay="{{ overlay }}"
|
overlay="{{ overlay }}"
|
||||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||||
duration="{{ transition ? duration : 0 }}"
|
duration="{{ transition ? duration : 0 }}"
|
||||||
|
safe-area-tab-bar="{{ safeAreaTabBar }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
|
rootPortal="{{ rootPortal }}"
|
||||||
bind:enter="onOpen"
|
bind:enter="onOpen"
|
||||||
bind:leave="onClose"
|
bind:leave="onClose"
|
||||||
bind:close="toggle"
|
bind:close="toggle"
|
||||||
@ -30,7 +32,7 @@
|
|||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
slot="title"
|
slot="title"
|
||||||
class="van-dropdown-item__title"
|
class="van-dropdown-item__title item-title-class"
|
||||||
style="{{ item.value === value ? 'color:' + activeColor : '' }}"
|
style="{{ item.value === value ? 'color:' + activeColor : '' }}"
|
||||||
>
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
|
5
dist/dropdown-item/shared.d.ts
vendored
Normal file
5
dist/dropdown-item/shared.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export interface Option {
|
||||||
|
text: string;
|
||||||
|
value: string | number;
|
||||||
|
icon: string;
|
||||||
|
}
|
1
dist/dropdown-menu/index.d.ts
vendored
Normal file
1
dist/dropdown-menu/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
5
dist/dropdown-menu/index.js
vendored
5
dist/dropdown-menu/index.js
vendored
@ -4,6 +4,7 @@ import { addUnit, getRect, getSystemInfoSync } from '../common/utils';
|
|||||||
let ARRAY = [];
|
let ARRAY = [];
|
||||||
VantComponent({
|
VantComponent({
|
||||||
field: true,
|
field: true,
|
||||||
|
classes: ['title-class'],
|
||||||
relation: useChildren('dropdown-item', function () {
|
relation: useChildren('dropdown-item', function () {
|
||||||
this.updateItemListData();
|
this.updateItemListData();
|
||||||
}),
|
}),
|
||||||
@ -31,6 +32,10 @@ VantComponent({
|
|||||||
value: 'down',
|
value: 'down',
|
||||||
observer: 'updateChildrenData',
|
observer: 'updateChildrenData',
|
||||||
},
|
},
|
||||||
|
safeAreaTabBar: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
closeOnClickOverlay: {
|
closeOnClickOverlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
|
2
dist/dropdown-menu/index.wxml
vendored
2
dist/dropdown-menu/index.wxml
vendored
@ -10,7 +10,7 @@
|
|||||||
bind:tap="onTitleTap"
|
bind:tap="onTitleTap"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
class="{{ item.titleClass }} {{ utils.bem('dropdown-menu__title', { active: item.showPopup, down: item.showPopup === (direction === 'down') }) }}"
|
class="{{ item.titleClass }} {{ utils.bem('dropdown-menu__title', { active: item.showPopup, down: item.showPopup === (direction === 'down') }) }} title-class"
|
||||||
style="{{ item.showPopup ? 'color:' + activeColor : '' }}"
|
style="{{ item.showPopup ? 'color:' + activeColor : '' }}"
|
||||||
>
|
>
|
||||||
<view class="van-ellipsis">
|
<view class="van-ellipsis">
|
||||||
|
2
dist/dropdown-menu/index.wxss
vendored
2
dist/dropdown-menu/index.wxss
vendored
@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:-4px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
1
dist/empty/index.d.ts
vendored
Normal file
1
dist/empty/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/field/index.d.ts
vendored
Normal file
1
dist/field/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
53
dist/field/index.js
vendored
53
dist/field/index.js
vendored
@ -22,22 +22,45 @@ VantComponent({
|
|||||||
}, clearIcon: {
|
}, clearIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
value: 'clear',
|
value: 'clear',
|
||||||
|
}, extraEventParams: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
} }),
|
} }),
|
||||||
data: {
|
data: {
|
||||||
focused: false,
|
focused: false,
|
||||||
innerValue: '',
|
innerValue: '',
|
||||||
showClear: false,
|
showClear: false,
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value(value) {
|
||||||
|
if (value !== this.value) {
|
||||||
|
this.setData({ innerValue: value });
|
||||||
|
this.value = value;
|
||||||
|
this.setShowClear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearTrigger() {
|
||||||
|
this.setShowClear();
|
||||||
|
},
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.value = this.data.value;
|
this.value = this.data.value;
|
||||||
this.setData({ innerValue: this.value });
|
this.setData({ innerValue: this.value });
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatValue(value) {
|
||||||
|
const { maxlength } = this.data;
|
||||||
|
if (maxlength !== -1 && value.length > maxlength) {
|
||||||
|
return value.slice(0, maxlength);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
},
|
||||||
onInput(event) {
|
onInput(event) {
|
||||||
const { value = '' } = event.detail || {};
|
const { value = '' } = event.detail || {};
|
||||||
this.value = value;
|
const formatValue = this.formatValue(value);
|
||||||
|
this.value = formatValue;
|
||||||
this.setShowClear();
|
this.setShowClear();
|
||||||
this.emitChange();
|
return this.emitChange(Object.assign(Object.assign({}, event.detail), { value: formatValue }));
|
||||||
},
|
},
|
||||||
onFocus(event) {
|
onFocus(event) {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
@ -60,7 +83,7 @@ VantComponent({
|
|||||||
this.value = '';
|
this.value = '';
|
||||||
this.setShowClear();
|
this.setShowClear();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
this.emitChange();
|
this.emitChange({ value: '' });
|
||||||
this.$emit('clear', '');
|
this.$emit('clear', '');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -76,7 +99,7 @@ VantComponent({
|
|||||||
if (value === '') {
|
if (value === '') {
|
||||||
this.setData({ innerValue: '' });
|
this.setData({ innerValue: '' });
|
||||||
}
|
}
|
||||||
this.emitChange();
|
this.emitChange({ value });
|
||||||
},
|
},
|
||||||
onLineChange(event) {
|
onLineChange(event) {
|
||||||
this.$emit('linechange', event.detail);
|
this.$emit('linechange', event.detail);
|
||||||
@ -84,12 +107,20 @@ VantComponent({
|
|||||||
onKeyboardHeightChange(event) {
|
onKeyboardHeightChange(event) {
|
||||||
this.$emit('keyboardheightchange', event.detail);
|
this.$emit('keyboardheightchange', event.detail);
|
||||||
},
|
},
|
||||||
emitChange() {
|
onBindNicknameReview(event) {
|
||||||
this.setData({ value: this.value });
|
this.$emit('nicknamereview', event.detail);
|
||||||
nextTick(() => {
|
},
|
||||||
this.$emit('input', this.value);
|
emitChange(detail) {
|
||||||
this.$emit('change', this.value);
|
const { extraEventParams } = this.data;
|
||||||
});
|
this.setData({ value: detail.value });
|
||||||
|
let result;
|
||||||
|
const data = extraEventParams
|
||||||
|
? Object.assign(Object.assign({}, detail), { callback: (data) => {
|
||||||
|
result = data;
|
||||||
|
} }) : detail.value;
|
||||||
|
this.$emit('input', data);
|
||||||
|
this.$emit('change', data);
|
||||||
|
return result;
|
||||||
},
|
},
|
||||||
setShowClear() {
|
setShowClear() {
|
||||||
const { clearable, readonly, clearTrigger } = this.data;
|
const { clearable, readonly, clearTrigger } = this.data;
|
||||||
@ -100,7 +131,7 @@ VantComponent({
|
|||||||
const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
||||||
showClear = hasValue && trigger;
|
showClear = hasValue && trigger;
|
||||||
}
|
}
|
||||||
this.setData({ showClear });
|
this.setView({ showClear });
|
||||||
},
|
},
|
||||||
noop() { },
|
noop() { },
|
||||||
},
|
},
|
||||||
|
14
dist/field/index.wxml
vendored
14
dist/field/index.wxml
vendored
@ -13,12 +13,12 @@
|
|||||||
title-style="margin-right: 12px;"
|
title-style="margin-right: 12px;"
|
||||||
custom-style="{{ customStyle }}"
|
custom-style="{{ customStyle }}"
|
||||||
arrow-direction="{{ arrowDirection }}"
|
arrow-direction="{{ arrowDirection }}"
|
||||||
custom-class="van-field"
|
custom-class="custom-class van-field"
|
||||||
>
|
>
|
||||||
<slot name="left-icon" slot="icon" />
|
<slot name="left-icon" slot="icon" />
|
||||||
<view wx:if="{{ label }}" class="label-class {{ utils.bem('field__label', { disabled }) }}" slot="title">
|
<label for="{{ name }}" wx:if="{{ label }}" class="label-class {{ utils.bem('field__label', { disabled }) }}" slot="title">
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</view>
|
</label>
|
||||||
<slot wx:else name="label" slot="title" />
|
<slot wx:else name="label" slot="title" />
|
||||||
<view class="{{ utils.bem('field__body', [type]) }}">
|
<view class="{{ utils.bem('field__body', [type]) }}">
|
||||||
<view class="{{ utils.bem('field__control', [inputAlign, 'custom']) }}" bindtap="onClickInput">
|
<view class="{{ utils.bem('field__control', [inputAlign, 'custom']) }}" bindtap="onClickInput">
|
||||||
@ -47,10 +47,10 @@
|
|||||||
<slot name="button" />
|
<slot name="button" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{ showWordLimit && maxlength }}" class="van-field__word-limit">
|
<label for="{{ name }}" wx:if="{{ showWordLimit && maxlength }}" class="van-field__word-limit">
|
||||||
<view class="{{ utils.bem('field__word-num', { full: value.length >= maxlength }) }}">{{ value.length >= maxlength ? maxlength : value.length }}</view>/{{ maxlength }}
|
<view class="{{ utils.bem('field__word-num', { full: value.length >= maxlength }) }}">{{ value.length >= maxlength ? maxlength : value.length }}</view>/{{ maxlength }}
|
||||||
</view>
|
</label>
|
||||||
<view wx:if="{{ errorMessage }}" class="{{ utils.bem('field__error-message', [errorMessageAlign, { disabled, error }]) }}">
|
<label for="{{ name }}" wx:if="{{ errorMessage }}" class="{{ utils.bem('field__error-message', [errorMessageAlign, { disabled, error }]) }}">
|
||||||
{{ errorMessage }}
|
{{ errorMessage }}
|
||||||
</view>
|
</label>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
|
2
dist/field/index.wxss
vendored
2
dist/field/index.wxss
vendored
@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)}
|
@import '../common/index.wxss';.van-field{--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:var(--field-label-color,#646566)}.van-field__label--disabled{color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{align-items:center;display:flex}.van-field__body--textarea{box-sizing:border-box;line-height:1.2em;min-height:var(--cell-line-height,24px);padding:3.6px 0}.van-field__control:empty+.van-field__control{display:block}.van-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,#323233);display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:left;width:100%}.van-field__control:empty{display:none}.van-field__control--textarea{height:var(--field-text-area-min-height,18px);min-height:var(--field-text-area-min-height,18px)}.van-field__control--error{color:var(--field-input-error-text-color,#ee0a24)}.van-field__control--disabled{background-color:initial;color:var(--field-input-disabled-text-color,#c8c9cc);opacity:1}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.van-field__control--custom{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__placeholder{color:var(--field-placeholder-text-color,#c8c9cc);left:0;pointer-events:none;position:absolute;right:0;top:0}.van-field__placeholder--error{color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.van-field__button,.van-field__clear-root,.van-field__icon-container{flex-shrink:0}.van-field__clear-root{color:var(--field-clear-icon-color,#c8c9cc);font-size:var(--field-clear-icon-size,16px)}.van-field__icon-container{color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{color:var(--field-error-message-color,#ee0a24);display:block;font-size:var(--field-error-message-text-font-size,12px);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{color:var(--field-word-limit-color,#646566);font-size:var(--field-word-limit-font-size,12px);line-height:var(--field-word-limit-line-height,16px);margin-top:var(--padding-base,4px);text-align:right}.van-field__word-num{display:inline}.van-field__word-num--full{color:var(--field-word-num-full-color,#ee0a24)}
|
3
dist/field/input.wxml
vendored
3
dist/field/input.wxml
vendored
@ -1,4 +1,6 @@
|
|||||||
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
<input
|
<input
|
||||||
|
id="{{ name }}"
|
||||||
class="{{ utils.bem('field__control', [inputAlign, { disabled, error }]) }} input-class"
|
class="{{ utils.bem('field__control', [inputAlign, { disabled, error }]) }} input-class"
|
||||||
type="{{ type }}"
|
type="{{ type }}"
|
||||||
focus="{{ focus }}"
|
focus="{{ focus }}"
|
||||||
@ -25,4 +27,5 @@
|
|||||||
bindfocus="onFocus"
|
bindfocus="onFocus"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||||
|
bindnicknamereview="onBindNicknameReview"
|
||||||
/>
|
/>
|
||||||
|
4
dist/field/props.d.ts
vendored
Normal file
4
dist/field/props.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="miniprogram-api-typings" />
|
||||||
|
export declare const commonProps: WechatMiniprogram.Component.PropertyOption;
|
||||||
|
export declare const inputProps: WechatMiniprogram.Component.PropertyOption;
|
||||||
|
export declare const textareaProps: WechatMiniprogram.Component.PropertyOption;
|
10
dist/field/props.js
vendored
10
dist/field/props.js
vendored
@ -1,13 +1,5 @@
|
|||||||
export const commonProps = {
|
export const commonProps = {
|
||||||
value: {
|
value: String,
|
||||||
type: String,
|
|
||||||
observer(value) {
|
|
||||||
if (value !== this.value) {
|
|
||||||
this.setData({ innerValue: value });
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
placeholder: String,
|
placeholder: String,
|
||||||
placeholderStyle: String,
|
placeholderStyle: String,
|
||||||
placeholderClass: String,
|
placeholderClass: String,
|
||||||
|
3
dist/field/textarea.wxml
vendored
3
dist/field/textarea.wxml
vendored
@ -1,4 +1,7 @@
|
|||||||
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
|
<wxs src="./index.wxs" module="computed" />
|
||||||
<textarea
|
<textarea
|
||||||
|
id="{{ name }}"
|
||||||
class="{{ utils.bem('field__control', [inputAlign, type, { disabled, error }]) }} input-class"
|
class="{{ utils.bem('field__control', [inputAlign, type, { disabled, error }]) }} input-class"
|
||||||
fixed="{{ fixed }}"
|
fixed="{{ fixed }}"
|
||||||
focus="{{ focus }}"
|
focus="{{ focus }}"
|
||||||
|
8
dist/field/types.d.ts
vendored
Normal file
8
dist/field/types.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export interface InputDetails {
|
||||||
|
/** 输入框内容 */
|
||||||
|
value: string;
|
||||||
|
/** 光标位置 */
|
||||||
|
cursor?: number;
|
||||||
|
/** keyCode 为键值 (目前工具还不支持返回keyCode参数) `2.1.0` 起支持 */
|
||||||
|
keyCode?: number;
|
||||||
|
}
|
1
dist/field/types.js
vendored
Normal file
1
dist/field/types.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
1
dist/goods-action-button/index.d.ts
vendored
Normal file
1
dist/goods-action-button/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
8
dist/goods-action-button/index.js
vendored
8
dist/goods-action-button/index.js
vendored
@ -8,6 +8,10 @@ VantComponent({
|
|||||||
props: {
|
props: {
|
||||||
text: String,
|
text: String,
|
||||||
color: String,
|
color: String,
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
value: 'normal',
|
||||||
|
},
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
plain: Boolean,
|
plain: Boolean,
|
||||||
@ -15,6 +19,10 @@ VantComponent({
|
|||||||
type: String,
|
type: String,
|
||||||
value: 'danger',
|
value: 'danger',
|
||||||
},
|
},
|
||||||
|
customStyle: {
|
||||||
|
type: String,
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onClick(event) {
|
onClick(event) {
|
||||||
|
7
dist/goods-action-button/index.wxml
vendored
7
dist/goods-action-button/index.wxml
vendored
@ -1,15 +1,18 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
<van-button
|
<van-button
|
||||||
id="{{ id }}"
|
id="{{ id }}"
|
||||||
|
button-id="{{ buttonId }}"
|
||||||
lang="{{ lang }}"
|
lang="{{ lang }}"
|
||||||
type="{{ type }}"
|
type="{{ type }}"
|
||||||
|
size="{{ size }}"
|
||||||
color="{{ color }}"
|
color="{{ color }}"
|
||||||
plain="{{ plain }}"
|
plain="{{ plain }}"
|
||||||
loading="{{ loading }}"
|
loading="{{ loading }}"
|
||||||
disabled="{{ disabled }}"
|
disabled="{{ disabled }}"
|
||||||
open-type="{{ openType }}"
|
open-type="{{ openType }}"
|
||||||
class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain: plain }])}}"
|
class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast, plain: plain }])}}"
|
||||||
custom-class="van-goods-action-button__inner"
|
custom-class="van-goods-action-button__inner custom-class"
|
||||||
|
custom-style="{{customStyle}}"
|
||||||
business-id="{{ businessId }}"
|
business-id="{{ businessId }}"
|
||||||
session-from="{{ sessionFrom }}"
|
session-from="{{ sessionFrom }}"
|
||||||
app-parameter="{{ appParameter }}"
|
app-parameter="{{ appParameter }}"
|
||||||
@ -22,6 +25,8 @@
|
|||||||
bindcontact="onContact"
|
bindcontact="onContact"
|
||||||
bindopensetting="onOpenSetting"
|
bindopensetting="onOpenSetting"
|
||||||
bindgetuserinfo="onGetUserInfo"
|
bindgetuserinfo="onGetUserInfo"
|
||||||
|
bindagreeprivacyauthorization="onAgreePrivacyAuthorization"
|
||||||
|
bindgetRealTimePhoneNumber="onGetRealTimePhoneNumber"
|
||||||
bindgetphonenumber="onGetPhoneNumber"
|
bindgetphonenumber="onGetPhoneNumber"
|
||||||
bindlaunchapp="onLaunchApp"
|
bindlaunchapp="onLaunchApp"
|
||||||
>
|
>
|
||||||
|
1
dist/goods-action-icon/index.d.ts
vendored
Normal file
1
dist/goods-action-icon/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export {};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user