Compare commits

...

457 Commits
next ... v4.5.0

Author SHA1 Message Date
chenjiahan
82e5d39710 release: 4.5.0 2023-06-11 22:42:15 +08:00
chenjiahan
2dd3bf8aec docs(TimePicker): add descriptions for time range 2023-06-11 22:41:15 +08:00
chenjiahan
4dfd1fafb8 docs(TimePicker): fix invalid code block 2023-06-11 22:31:43 +08:00
neverland
c8983b3946
feat(FloatingPanel): add duration prop (#11964) 2023-06-11 22:23:05 +08:00
ShuGang Zhou
621c0fc2f1
feat(TimePicker): add min-time and max-time prop (#11887)
* feat(TimePicker): Only default columns support minTime and maxTime

* feat(TimePicker): adapted seconds, the specified format

* feat(TimePicker): adapted seconds, the specified format

* feat(TimePicker): adapted seconds, the specified format

* fix(TimePicker): conflicts that must be resolved

* fix(TimePicker): add props tag
2023-06-11 22:22:56 +08:00
inottn
41778cc9b3
feat(CI): add issue helper (#11963) 2023-06-11 22:18:19 +08:00
inottn
803292d982
feat(Slider): button slot add dragging param (#11946)
* feat(Slider): button slot add dragging param

* test(Slider): add test case
2023-06-11 21:02:13 +08:00
neverland
c701b826db
feat(FloatingPanel): allow to custom bar style (#11962) 2023-06-11 12:20:23 +08:00
neverland
b62a1bbcf6
docs(FloatingPanel): add some descriptions (#11960) 2023-06-11 12:11:46 +08:00
ShuGang Zhou
97fa5301fb
feat(AddressList): add new right-icon props (#11959) 2023-06-11 11:29:27 +08:00
zqran
803b471dbd
fix(BackTop): should hide when deactivated (#11938)
* fix(site): don't cache components using teleport

* feat: adapt keep-alive
2023-06-10 12:18:45 +08:00
inottn
5c9ce177f2
feat(FloatingPanel): add v-model:height prop (#11947)
* feat(FloatingPanel): Optimize the timing of height-change event triggering and add dragging param

* feat(FloatingPanel): add v-model:height prop
2023-06-10 12:12:48 +08:00
ShuGang Zhou
cfdf3a811e
docs(PickerGroup): add props tag (#11940) 2023-06-04 21:12:08 +08:00
ShuGang Zhou
514f56a322
docs: add new props tag (#11941)
* docs: add 4.4.1 props tag

* docs: add 4.4.0 props tag

* docs: add 4.2.0 props tag

* docs: add new  props tag
2023-06-04 21:08:58 +08:00
ShuGang Zhou
b8424849f0
feat(FloatingPanel): add new FloatingPanel component (#11832)
* fix(Swipe): props changed but component didn't

* fix(Swipe): target watch windowWidth

* Update packages/vant/src/swipe/Swipe.tsx

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* chore: sync

* feat(FloatingPanel): add new FloatingPanel component

* feat(FloatingPanel): add new FloatingPanel component

* feat(FloatingPanel): optimized code

* feat(FloatingPanel): optimized code

---------

Co-authored-by: zhousg <345313727@qq.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
2023-06-03 09:26:42 +08:00
inottn
890ad11822
feat(TimePicker): filter support values param to help get current values (#11916)
* feat(TimePicker): filter support values param to help get current values

* docs: update demo
2023-06-03 09:06:38 +08:00
Gavin
71c0cc71f2
feat(DropdownMenu): add close method (#11921)
* feat(DropdownMenu): add close method

* chore: update
2023-06-03 09:04:59 +08:00
ShuGang Zhou
88b17474fa
docs(Watermark): add props description (#11926) 2023-06-03 09:04:16 +08:00
inottn
93d51e85e5
docs(Picker): remove outdated content (#11927) 2023-06-03 09:03:53 +08:00
inottn
c4eaee3c69
docs(Uploader): fix preview-delete slot param (#11928) 2023-06-03 09:02:40 +08:00
ShuGang Zhou
63a8e4443e
feat(VantCli): mobile page refreshes are located based on the hash (#11918) 2023-05-30 21:20:38 +08:00
ShuGang Zhou
2e6a7b99d0
docs(IndexBar): update props type (#11923) 2023-05-30 21:17:09 +08:00
chenjiahan
0b9df74f8d docs(changelog): fix typo 2023-05-30 21:16:34 +08:00
neverland
3297289e39
docs(changelog): vant@4.4.1 (#11917) 2023-05-28 21:38:00 +08:00
chenjiahan
3c2821761a release: 4.4.1 2023-05-28 21:34:31 +08:00
Zhousg
6177bf00a2
fix(Popup): opened event is emitted twice when duration is 0 (#11902)
* fix(Popup): duration 0s and enable lazyRender opened is executed twice

* fix(Popup): optimized code
2023-05-28 16:18:54 +08:00
inottn
d9726883e6
feat(Popover): add actions-direction prop (#11888)
* feat(Popover): add direction prop

* fix: solve some problems
2023-05-28 16:01:15 +08:00
inottn
457e6a2015
fix(Slider): should update startValue when the slider is clicked (#11904) 2023-05-28 10:48:51 +08:00
neverland
b2d49a35d9
chore(Tab): using Vue built-in stringifyStyle (#11914)
* chore(Tab): using Vue built-in stringifyStyle

* fix(Tab): failed to normalize style
2023-05-28 10:31:34 +08:00
Zhousg
53a108ec7e
fix(Tab): Maximum recursive updates exceeded in Tabs (#11898)
* fix(Tab): Maximum recursive updates exceeded in component <van-tabs>

* fix(Tab): Maximum recursive updates exceeded in component <van-tabs>

* fix(Tab): Maximum recursive updates exceeded in component <van-tabs>

* fix(Tab): Maximum recursive updates exceeded in component <van-tabs>

* fix(Tab): Maximum recursive updates exceeded in component <van-tabs>
2023-05-27 10:39:39 +08:00
neverland
1dcfd2dac0
chore(deps): bump Vue v3.3 (#11913) 2023-05-26 22:22:06 +08:00
neverland
0d102db0ee
chore(deps): bump vite v4.3 (#11912) 2023-05-26 22:15:28 +08:00
inottn
f53b7e13ec
docs: fix error in migration guide (#11909) 2023-05-26 21:11:18 +08:00
inottn
e98e514acf
fix(ImagePreview): stop animation during initialization (#11897) 2023-05-22 21:42:20 +08:00
Zhousg
7139898d3a
docs(TreeSelect): props add v-model (#11899) 2023-05-22 21:40:14 +08:00
neverland
4a4422bb1c
docs(changelog): vant@4.4.0 (#11896) 2023-05-21 22:43:19 +08:00
chenjiahan
579276ea2f release: 4.4.0 2023-05-21 22:33:58 +08:00
neverland
8123222977
chore(Barrage): inherit font family by default (#11895) 2023-05-21 22:31:04 +08:00
neverland
b5bb20e6c1
chore(Barrage): rename speed to duration (#11894) 2023-05-21 22:28:08 +08:00
neverland
3bbe31da1b
docs(perf): lazy import transliteration (#11893) 2023-05-21 22:20:21 +08:00
Mikasa33
b4af4022c6
feat(Divider): add vertical prop (#11883)
* feat(Divider): add vertical prop

* feat(Divider): optimized code
2023-05-21 21:53:13 +08:00
Zhousg
708e4c6ea8
docs(Uploader): Optimized translation (#11886) 2023-05-21 21:50:41 +08:00
inottn
7a2e7d3eb6
docs(Signature): add background color demo (#11890)
* docs(Signature): add background color demo

* fix: update test snapshots
2023-05-21 21:50:19 +08:00
inottn
9e818162e2
docs(ImagePreview): optimize docs (#11892) 2023-05-21 21:49:14 +08:00
inottn
a8a04d3993
chore(ImagePreview): remove unused state (#11889) 2023-05-21 21:48:54 +08:00
inottn
dda09785ea
docs(Space): optimize docs (#11891) 2023-05-21 21:48:10 +08:00
inottn
fe2335eb09
feat(ImagePreview): optimize the preview effect of long images (#11857)
* feat(ImagePreview): optimize the preview effect of long images

* fix: optimize logic

* fix: optimize logic
2023-05-21 10:10:59 +08:00
Zhousg
08f82392b7
fix(BackTop): When teleport is the default, the parent scroll contain… (#11858)
* fix(BackTop): When teleport is the default, the parent scroll container is always window

* fix(BackTop): When teleport is the default, the parent scroll container is always window
2023-05-20 21:09:34 +08:00
Zhousg
b94c8c3333
feat(Uploader): add reupload (#11854)
* feat(Uploader): add reupload

* feat(Uploader): add reupload

* Update packages/vant/src/uploader/README.md

Co-authored-by: neverland <jait.chen@foxmail.com>

* Update packages/vant/src/uploader/README.zh-CN.md

Co-authored-by: neverland <jait.chen@foxmail.com>

---------

Co-authored-by: neverland <jait.chen@foxmail.com>
2023-05-20 19:15:29 +08:00
Jevon
b275e1867d
feat(docs): sync mobile position on anchor click (#11879) 2023-05-20 18:46:50 +08:00
Zhousg
52ab19e185
docs(Address): fix props and methods (#11882) 2023-05-20 18:36:06 +08:00
inottn
0670ebf8c1
feat(Cascader): scroll the selected option into view when switching tabs (#11869) 2023-05-17 22:30:06 +08:00
Mikasa33
ee0a332e8a
fix(ContactList): increase right icon size and optimize styles (#11873)
* 优化 ContactList 边距和圆角边框样式

* 优化 ContactList 的 Demo 标题样式

* 优化 ContactList 的单选框尺寸

* Update README.zh-CN.md

* Update README.md

* Update index.spec.ts.snap

* Update demo.spec.ts.snap

* Update demo-ssr.spec.ts.snap
2023-05-17 22:17:27 +08:00
Mikasa33
3867017d3a
fix(AddressEdit): hide border of the last cell (#11872)
* fix(AddressEdit): hide border of the last cell

* Update demo-ssr.spec.ts.snap

* Update demo.spec.ts.snap

* Update index.spec.ts.snap
2023-05-17 22:15:00 +08:00
Zhousg
71de1ad079
fix(Area): areaProps omit allow-html show-toolbar (#11871) 2023-05-17 22:14:02 +08:00
Zhousg
e457bc2265
docs(Area): fix docs events (#11870) 2023-05-17 22:12:56 +08:00
Zhousg
83a11a8aee
docs(ContactList): fix type (#11868) 2023-05-17 22:12:16 +08:00
inottn
2250013978
docs(Cascader): fix docs error (#11867) 2023-05-17 14:05:04 +08:00
Zhousg
c58b66ee33
docs(ContactEdit): fix docs type and emit (#11866) 2023-05-17 14:04:18 +08:00
Zhousg
be0d498c0e
docs(Coupon): fix docs type (#11865) 2023-05-17 14:03:15 +08:00
Mikasa33
cff0631b2b
fix(Dialog): fix the rounded corners of shadow when button is clicked (#11863) 2023-05-17 10:21:05 +08:00
inottn
57f115bee2
docs(ActionBar): fix docs error (#11864) 2023-05-17 10:14:08 +08:00
李江辰
467243d495
feat(signature): improve signature clarity by devicePixelRatio (#11835)
* feat(signature): Enhance signature clarity by devicePixelRatio

* refactor: optimize image generation logic

* Update Signature.tsx

---------

Co-authored-by: neverland <jait.chen@foxmail.com>
2023-05-15 21:26:54 +08:00
inottn
4b29f1006c
fix(DatePicker): should display correctly when modelValue is updated from external (#11839)
* fix(DatePicker): should be displayed correctly when modelValue updated by external sources

* fix: optimize logic
2023-05-15 21:21:00 +08:00
Zhousg
cb0f859a83
feat(Barrage): add new Barrage component (#11760)
* fix(Swipe): props changed but component didn't

* fix(Swipe): target watch windowWidth

* Update packages/vant/src/swipe/Swipe.tsx

* feat(Barrage): add new Barrage component

* feat(Barrage): add will-change

* feat: only use transform move

* refactor: only use transform

* refactor: only use transform

* fix(Barrage): many problems

* fix(Barrage): many problems

* fix(Barrage): many problems

* fix(Barrage): many problems

* fix(Barrage): many problems

* fix(Barrage): many problems

---------

Co-authored-by: zhousg <345313727@qq.com>
Co-authored-by: neverland <jait.chen@foxmail.com>
2023-05-14 22:06:15 +08:00
neverland
5a859ff019
docs(changelog): vant@4.3.2 (#11850) 2023-05-14 22:05:45 +08:00
chenjiahan
9db21e5328 release: 4.3.2 2023-05-14 22:01:57 +08:00
绯色琉璃
ca59be8ea6
fix(Filed): onclick label execute twice (#11838)
* fix(Filed): onclick label execute twice

* fix(Filed): onclick label execute twice

* Update Field.tsx

---------

Co-authored-by: zyc <1439655764>
Co-authored-by: neverland <jait.chen@foxmail.com>
2023-05-14 21:58:51 +08:00
inottn
d05972d229
feat(ImagePreview): use the touched point as the center of zooming (#11848) 2023-05-14 21:51:19 +08:00
Zhousg
127b5b28d3
fix(SubmitBar): Unused CSS variables (#11845) 2023-05-14 19:26:23 +08:00
Zhousg
8a32e861d8
docs(vant-use): fix docs type (#11844)
* docs(useClickAway): fix docs type

* docs(useCountDown): fix docs type
2023-05-14 19:25:28 +08:00
inottn
e124db7531
docs(ImagePreview): fix docs error (#11841) 2023-05-13 20:22:38 +08:00
neverland
56bb381c82
chore(CI): fix the set-output deprecation warning when deploy website (#11830) 2023-05-09 14:15:35 +08:00
chenjiahan
6b517ccdbb docs: fix changelog translation 2023-05-05 21:51:20 +08:00
Gavin
3dabce8e98
feat(PickerGroup): the tab of PickerGroup supports controlled mode (#11771)
* feat(PickerGroup): add method to set the active of tab

* chore: update

* chore: format code

* chore: update

* chore: update

* docs: update docs
2023-05-05 21:40:49 +08:00
inottn
e0ae206c89
fix(Tab): should cancel raf before the next scroll (#11819)
* fix(Tab): should cancel raf before the next scroll

* fix(Tab): consider the case where multiple components exist at the same time
2023-05-05 21:38:52 +08:00
inottn
bfd9995583
fix(Steps): fix the style that occurs when there is only one step (#11822) 2023-05-05 21:33:14 +08:00
inottn
13ce11f608
fix(Checkbox): disabled unchecked options when the limit is exceeded (#11814)
* fix(Checkbox): disabled unchecked options when the limit is exceeded

* fix: ts def
2023-05-05 10:04:36 +08:00
inottn
5ec43156d0
types(DatePicker): fix ts def (#11813) 2023-05-04 09:49:12 +08:00
neverland
584a62875e
docs(changelog): vant@4.3.1 (#11816) 2023-05-04 09:46:23 +08:00
chenjiahan
37d3cfe83d release: 4.3.1 2023-05-04 09:36:49 +08:00
neverland
d08270831b
fix: release-it can not handle workspace protocol (#11815) 2023-05-04 09:35:37 +08:00
neverland
f8bb5a5b4b
docs(changelog): vant@4.3.0 (#11811) 2023-05-03 22:24:40 +08:00
chenjiahan
f57402d940 release: 4.3.0 2023-05-03 22:20:01 +08:00
neverland
7726eee160
fix(Image): failed to display loading when using lazy-load (#11809) 2023-05-03 22:18:46 +08:00
neverland
5874fc787e
chore(Sketch): update primary color (#11808) 2023-05-03 12:44:25 +08:00
neverland
12c3570e70
chore(Signature): improve clear button text (#11807) 2023-05-02 22:08:26 +08:00
neverland
0f47224b46
chore(Signature): rename filePath param to image (#11806) 2023-05-02 20:46:32 +08:00
neverland
8f54235eea
test: add SSR tests for all demo (#11805) 2023-05-02 20:19:47 +08:00
inottn
f3fa7e7bd5
fix(TimePicker): should update modelValue correctly (#11804) 2023-05-02 20:00:39 +08:00
neverland
9105243850
chore: add some SSR test cases (#11801) 2023-05-02 11:15:14 +08:00
neverland
da138d5321
fix(Field): disabled cursor should be not-allowed (#11800) 2023-05-02 10:36:03 +08:00
neverland
f9cd6b979f
feat(Field): increase default icon size to 18px (#11799) 2023-05-02 10:24:11 +08:00
neverland
064f675df8
feat(Signature): support custom button text (#11798) 2023-05-02 10:05:41 +08:00
neverland
c4e114fc33
fix(Signature): failed to sign in mobile devices (#11797) 2023-05-01 16:40:44 +08:00
neverland
77c1d589ca
fix(Signature): should prevent page move when signing (#11796) 2023-05-01 16:34:17 +08:00
neverland
5374a2f317
chore(Signature): improve default style (#11795) 2023-05-01 16:20:03 +08:00
neverland
51f7cefd96
fix(Signature): should render tips correctly (#11794) 2023-05-01 15:37:32 +08:00
neverland
8987c5856a
chore(Signature): improve ctx typing (#11793) 2023-05-01 11:57:20 +08:00
neverland
21e3c13928
docs(Signature): fix component name (#11792) 2023-05-01 11:50:53 +08:00
李江辰
f2b1b3156e
feat(signature): add Signature component (#11733)
* feat(signature): add signature component

* feat(signature): fix md naming error

* feat(signature): refactor and adjust code
2023-05-01 11:30:52 +08:00
neverland
dc1531084b
chore: using workspace protocol for vant package (#11791) 2023-05-01 11:30:08 +08:00
neverland
d4f04b1ab9
chore: add question links (#11789) 2023-05-01 10:51:19 +08:00
neverland
5c843f77c5
docs(changelog): vant@4.2.1 (#11787) 2023-04-30 21:24:27 +08:00
chenjiahan
e39e1402b2 release: 4.2.1 2023-04-30 21:17:02 +08:00
neverland
2580fe4342
docs(TimePicker): fix formatter demo (#11786) 2023-04-30 19:58:40 +08:00
inottn
5e7a6a212c
docs(TimePicker): fix docs error (#11784) 2023-04-30 19:49:58 +08:00
neverland
e696d35bd4
refactor(Tabs): move renderTitle to Tab component (#11781) 2023-04-27 08:09:08 +08:00
neverland
a052b410cb
feat(Pagination): add show-prev-button, show-next-button props (#11780) 2023-04-26 20:27:08 +08:00
neverland
c7df4290e2
fix(Pagination): don't show click feedback when button is disabled (#11779) 2023-04-26 20:18:23 +08:00
neverland
f10557a211
fix(Tabs): should scroll active tab into view after resized (#11777) 2023-04-26 20:04:22 +08:00
neverland
cbaa4b0d3a
fix(Tabs): re-render when line-width or line-height changed (#11776) 2023-04-26 19:56:24 +08:00
Zhousg
68d1ade239
fix(Sticky): resize or orientationchange wrapper no reset width and height (#11753)
* fix(Swipe): props changed but component didn't

* fix(Swipe): target watch windowWidth

* Update packages/vant/src/swipe/Swipe.tsx

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

* fix(Sticky): resize or orientationchange wrapper no reset width and height

---------

Co-authored-by: neverland <jait.chen@foxmail.com>
2023-04-26 19:40:25 +08:00
Cyrbuzz
5338367ea3
fix(Watermark): add xlink namespace and fix blob MIME type (#11762)
* fix(watermark): add xlink namespace and fix blob MIME type

* test(watermark): test snapshots
2023-04-20 18:42:15 +08:00
neverland
5e4bbab00c
feat(Picker): add scroll-into event (#11757) 2023-04-16 21:25:49 +08:00
neverland
9e1640180b
docs(changelog): vant@4.2.0 (#11756) 2023-04-16 11:22:29 +08:00
chenjiahan
c36ec55d7b release: 4.2.0 2023-04-16 11:14:09 +08:00
neverland
d876b1f8be
chore(Watermark): rename default slot to content (#11755) 2023-04-16 11:13:02 +08:00
neverland
8bc6169ae1
chore(deps): bump consola v3 and rimraf v5 (#11751)
* chore(deps): bump consola v3 and rimraf v5

* chore: revert demo
2023-04-15 09:36:41 +08:00
Zhousg
17055a94c7
fix(Swipe): should resize after props.width/height changed (#11747)
* fix(Swipe): props changed but component didn't

* fix(Swipe): target watch windowWidth

* Update packages/vant/src/swipe/Swipe.tsx

---------

Co-authored-by: neverland <jait.chen@foxmail.com>
2023-04-15 09:28:02 +08:00
neverland
8bc9b262f2
feat(TextEllipsis): add dots prop (#11745)
* feat(TextEllipsis): add dots prop

* chore: update snap
2023-04-09 10:57:34 +08:00
neverland
949c535889
docs(TextEllipsis): add some sentence (#11744) 2023-04-08 22:19:53 +08:00
neverland
726a47b414
chore(Watermark): rename font-color to text-color (#11743) 2023-04-08 19:39:10 +08:00
neverland
0a5e26de15
feat(Watermark): support opacity to be a string (#11742) 2023-04-08 19:32:10 +08:00
neverland
7444543bc1
docs(Watermark): improve image watermark demos (#11741) 2023-04-08 11:03:28 +08:00
neverland
9008df9e90
feat(Watermark): add --van-watermark-z-index css var (#11734) 2023-04-05 21:29:38 +08:00
chenjiahan
c43a6406ea docs: add component version tip 2023-04-05 21:15:46 +08:00
Cyrbuzz
69b113717f
feat(Watermark): add new Watermark component (#11721)
* feat(watermark): add watermark component

* docs(watermark): i18n

* feat(watermark): revoke useless url

* feat(watermark): add opacity, replace fullPage default to true, replace Zindex default to 100, replace fontColor default to #dedee0

* test(watermark): add watermark snap test

* docs(watermark): fix opacity and default value
2023-04-05 21:06:20 +08:00
gyt95
cac003cef5
docs: fix link about date-picker in release-note-v4 (#11730) 2023-04-05 10:59:40 +08:00
chenjiahan
1927c7462b chore(CI): sync to gitee after release 2023-04-02 13:39:05 +08:00
neverland
d077828637
docs(Circle): add stroke-width description (#11728) 2023-04-02 11:55:25 +08:00
neverland
15a41302b3
chore: bump pnpm to v8 (#11726) 2023-04-01 20:59:24 +08:00
neverland
53260297bd
docs(ConfigProvider): optimize theme demo (#11725) 2023-04-01 20:40:29 +08:00
MrXwq
28885fdee5
fix(ShareSheet): allow custom icon (#11709)
Co-authored-by: xuwenqiang <xuwenqiang@kanzhun.com>
2023-03-31 08:57:06 +08:00
Gavin
34634f645d
docs(Popup): fix code in docs to be the same as in demo (#11717) 2023-03-29 21:05:07 +08:00
neverland
58fb3402b6
docs(changelog): vant v4.1.2 (#11708) 2023-03-26 12:21:42 +08:00
chenjiahan
33ba747071 release: 4.1.2 2023-03-26 12:13:09 +08:00
neverland
81d36aa9ac
docs(Field): consistent with demo (#11707) 2023-03-26 12:11:42 +08:00
Jungzl
1c1e2e3b27
fix(Field): label-align top works well with label-width (#11684)
* fix(Field): label-align top works well with label-width

* fix(Field): update snapshot

* fix(Field): break long label when `labelAlign="top"`
2023-03-26 11:39:45 +08:00
Jungzl
07c0e3e9da
fix(Field): should emit blur event when readonly (#11699) 2023-03-25 09:20:12 +08:00
MrXwq
d883591b91
fix(ImagePreview): long vertical images sliding up and down (#11702)
Co-authored-by: xuwenqiang <xuwenqiang@kanzhun.com>
2023-03-25 09:15:15 +08:00
neverland
3cc3c29853
docs: add Khmer to zh document (#11703) 2023-03-25 09:09:32 +08:00
Chrea Chanchhunneng
fc215d3d5b
feat(Locale): Added Khmer Translaions (#11701)
Co-authored-by: Rio <chhunnneng.maya@gmail.com>
2023-03-25 09:06:40 +08:00
chenjiahan
9fa1cbb9dc chore: format release commit message 2023-03-19 20:49:39 +08:00
neverland
2ee3c96df4
docs(changelog): vant v4.1.1 (#11683) 2023-03-19 20:48:02 +08:00
chenjiahan
1feefde2a6 release: 4.1.1 2023-03-19 20:43:48 +08:00
chenjiahan
9bb0571dd2 docs(changelog): @vant/cli v6.1.0 2023-03-19 09:28:19 +08:00
chenjiahan
8218774b12 release: @vant/cli 6.1.0 2023-03-19 09:26:37 +08:00
neverland
e6575ae47b
feat(cli): bump vite 4.2, esbuild 0.17 (#11682) 2023-03-19 09:21:15 +08:00
neverland
1d5b37930a
chore(deps): bump typescript v5 (#11681) 2023-03-18 08:46:01 +08:00
neverland
7dce6d2f30
fix(cli): print tsc error correctly (#11680) 2023-03-18 08:41:00 +08:00
眼圈发黑
2322f1d765
fix(lazy-image): delete duplicate assignments (#11679) 2023-03-18 08:20:05 +08:00
Wei-Liang Liou
4aa33c17a6
fix(Field): correct typo "Filed" (#11674)
* refactor(search): fix typo filed

* docs: fix typo "filed" of comments

* fix(field): typo "FiledRuleFormatter"
2023-03-15 20:59:02 +08:00
Gavin
b9862b3c41
fix(DatePicker): fix display back wrong of date-picker (#11656)
* fix(DatePicker): fix display back wrong of date-picker

* feat: add test case for multi-column picker
2023-03-14 08:49:23 +08:00
Gavin
13a91147ce
fix(TextEllipsis): fix that numbers and letters cannot display ellipses (#11669) 2023-03-14 08:48:33 +08:00
neverland
065caff468
docs(Cascader): improve async loading demo (#11666) 2023-03-12 21:23:38 +08:00
neverland
bb64d6eedb
chore: bump vue to latest version (#11665) 2023-03-12 21:04:02 +08:00
neverland
d227d8cb5a
docs(changelog): @vant/cli@6.0.1 (#11664) 2023-03-12 15:06:10 +08:00
chenjiahan
abe3ac8eff release: @vant/cli 6.0.1 2023-03-12 15:03:16 +08:00
hminghe
965724e8a5
fix(@vant/cli): replace vue file import causing duplicate suffixes (#11649)
* fix(@vant/cli):替换 vue 文件导入出现重复后缀

* fix(@vant/cli):替换 vue 文件导入出现重复后缀
2023-03-12 14:58:49 +08:00
neverland
b9811558e5
docs(changelog): @vant/use 1.5.1 (#11663) 2023-03-12 14:47:17 +08:00
chenjiahan
1d5bae36b1 release: @vant/use 1.5.1 2023-03-12 14:43:12 +08:00
neverland
773a413fe0
fix(@vant/use): add vue as peer dependencies (#11662) 2023-03-12 14:42:30 +08:00
chenxueli
4428e4770a feat(Uploader): support avif image format (#11655) 2023-03-09 09:35:09 +08:00
chenjiahan
899714b4d8 release: @vant/area-data 1.4.1 2023-03-09 09:34:51 +08:00
郭军宏
df943630a7
feat(Area): update area data (#11645) 2023-03-09 09:33:13 +08:00
neverland
1ba9f6de4f
docs(changelog): vant@4.1.0 (#11643) 2023-03-05 19:56:34 +08:00
chenjiahan
1d7f0c9aff release: 4.1.0 2023-03-05 19:47:04 +08:00
Gavin
6c42fa0a4e
fix(DropdownMenu): fix dropdown-item position when expanded by default (#11640)
* fix(DropdownMenu): fix dropdown-item position when expanded by default

* chore: delete redundant code
2023-03-05 19:43:47 +08:00
neverland
0547527f5b
feat(TreeSelect): add item param to nav-text slot (#11641)
* feat(TreeSelect): add item param to nav-text slot

* chore: fix case name
2023-03-04 15:47:39 +08:00
Leon Fong
572e2482d9
feat(TreeSelect): add nav-text slot (#11602)
* feat(TreeSelect): render HTML toggling allowHtml

* feat(TreeSelect): Custom name of the parent node

* docs(TreeSelect): Add nav-text slot
2023-03-04 15:29:02 +08:00
SaberA1ter
2d72821de0
feat(Swipe): add index when trigger onDragStart or onDragEnd (#11632)
* perf(Swipe): add index when trigger onDragStart or onDragEnd

* perf(Swipe): change the arguments of the onDragStart and onDragEnd events to the Object

---------

Co-authored-by: ZZQChongYa <zhengziqiang@star-net.cn>
2023-03-04 15:19:31 +08:00
Alexsander Vyshnyvetskyy
c63fee0d13
fix(Locale): improve uk lang (#11629) 2023-02-27 20:10:32 +08:00
neverland
47d1dd4148
fix(TextEllipsis): failed to inherit attrs (#11621) 2023-02-26 18:45:10 +08:00
neverland
c00d389f77
docs: add @landluck and @wjw-gavin to core team (#11622) 2023-02-26 11:00:48 +08:00
neverland
fb3142af5e
feat(TextEllipsis): add van-text-ellipsis-line-height CSS var (#11620) 2023-02-26 10:34:02 +08:00
Gavin
0661f1f1fa
feat(TextEllipsis): add TextEllipsis component (#11593)
* chore: add menu

* feat(Ellipsis): add Ellipsis component

* style: improve style

* chore: improve resize observer

* chore: improve code

* chore: rename to text-ellipsis
2023-02-26 10:21:03 +08:00
chenjiahan
9f17342936 release: create-vant-cli-app 2.2.0 2023-02-26 10:19:28 +08:00
neverland
bc8bacfa6c
docs(@vant/cli): changelog v6.0.0 (#11619) 2023-02-26 10:18:43 +08:00
chenjiahan
1ffca78d7f release: @vant/cli 6.0.0 2023-02-26 10:14:03 +08:00
chenjiahan
06d8a23c65 release: @vant/cli 5.1.1 2023-02-26 10:08:06 +08:00
neverland
5954997314
fix(cli): failed to match arguments in some cases (#11618)
* fix(cli): failed to match arguments in some cases

* chore: upd
2023-02-26 10:07:31 +08:00
chenjiahan
40d1c97f6b chore(CI): add clean-exclude 2023-02-25 20:39:46 +08:00
neverland
c2f57ded43
docs: clean website assets (#11617) 2023-02-25 20:06:33 +08:00
neverland
a9864d5071
docs: remove v3 version tag in v4 document (#11616) 2023-02-25 19:55:08 +08:00
neverland
cf1de18dde
docs(Cell): remove value only document (#11615) 2023-02-25 19:08:57 +08:00
Gavin
73bab646a1
fix(Field): fix label-align top not work when set label-width (#11611)
* fix(Field): fix Field label-align

* style: delete some redundant css

* style: delete some redundant css
2023-02-25 16:59:42 +08:00
文博
1940541ea3
docs: ✏️ fix demo code in Dialog documentation (#11610) 2023-02-23 11:35:40 +08:00
neverland
d7e6618903
docs(changelog): vant@4.0.11 (#11597) 2023-02-20 09:19:13 +08:00
chenjiahan
e50fabd00a release: 4.0.11 2023-02-20 09:13:09 +08:00
neverland
39d8c23d25
chore(deps): bump commander & fs-extra (#11595) 2023-02-18 20:46:27 +08:00
neverland
012d2aa141
feat(Picker): expose option index to option slot (#11594) 2023-02-18 15:54:35 +08:00
chenjiahan
5b9d870bf8 docs: add Vant Module to features list 2023-02-18 15:10:53 +08:00
chenjiahan
e3c8a47e60 docs: update README.md 2023-02-18 15:02:43 +08:00
Gavin
d6213a7b4e
feat(BackTop): support css variable and prop of z-index (#11582)
* feat(BackTop): support css variable and prop of z-index

* docs: update README
2023-02-18 14:54:44 +08:00
Fengyuan Chen
388e76b54c
fix(Popover): fix the arrow position of *-start/end placements (#11584) 2023-02-18 14:51:36 +08:00
qiang
05f60fe401
docs: add an introduction to van-nuxt (#11588)
* docs: add an introduction to van-nuxt

* fix: typo
2023-02-17 13:02:21 +08:00
neverland
267f23dc58
feat(cli): improve code highlight (#11569) 2023-02-12 10:22:27 +08:00
acyza
9cbb2f56fa
fix(Popover): should update location after transition (#11568)
* fix(popover): location update

* fix(popover): update
2023-02-12 09:52:50 +08:00
Gavin
a21833f973
fix(PickerGroup): fix style of tab-line caused by v-show (#11547)
* fix(PickerGroup): fix style of tab-line caused by v-show

* chore: replce ResizeObserver api with useVisibilityChange
2023-02-11 22:17:43 +08:00
neverland
4bd7e85b5d
fix(PickerGroup): confirm event missing params (#11566) 2023-02-11 16:46:55 +08:00
acyza
a2ab97f328
fix(PickerGroup): Invalid slot (#11564)
* fix(PickerGroup): Invalid slot

* Update PickerGroup.tsx

---------

Co-authored-by: neverland <jait.chen@foxmail.com>
2023-02-10 21:43:08 +08:00
Gavin
0e01ea3b35
fix(Form): fix FieldTypeArea demo of form (#11561) 2023-02-10 11:16:27 +08:00
Gavin
ec2e12dea7
docs(Form): fix error variable of the form (#11560) 2023-02-10 10:24:48 +08:00
qiang
c05c31772a
fix(Space): Text is not defined in SSR (#11549) 2023-02-07 10:13:30 +08:00
chenjiahan
ff14e7585b docs: add customizable to slogan 2023-02-05 20:36:52 +08:00
chenjiahan
51aaf3aaa3 docs: update english slogan 2023-02-05 12:12:13 +08:00
chenjiahan
ebbdf728f9 docs(changelog): @vant/use v1.5.0 2023-02-04 21:16:03 +08:00
chenjiahan
ea1efbce95 release: @vant/use 1.5.0 2023-02-04 21:14:10 +08:00
neverland
ec987530b9
feat(@vant/use): support cleanup useEventListener (#11540) 2023-02-04 21:13:38 +08:00
neverland
2c2ceddc05
docs(changelog): vant@4.0.10 (#11536) 2023-02-02 23:39:12 +08:00
chenjiahan
80afba8050 release: 4.0.10 2023-02-02 23:36:14 +08:00
Gavin
8bd56f0897
fix(DatePicker): fix the value is not updated in time of change event (#11529) 2023-02-02 23:33:47 +08:00
neverland
5412837a87
fix(Slider): wrong behavior in two-thumb mode (#11534) 2023-02-02 23:28:49 +08:00
zhbhun
8706f31e8a
fix(slider): fix the problem that the slider button does not work properly in two-thumb mode (#11526) 2023-02-02 23:20:54 +08:00
chenjiahan
311faaa0e7 docs: improve padding and update locales number 2023-01-26 11:45:21 +08:00
neverland
ffd943aa49
docs(Cascader): add china area data demo (#11523)
* docs(Cascader): add china area data demo

* docs: upd
2023-01-26 11:24:38 +08:00
neverland
4f1d550706
docs(changelog): vant@4.0.9 (#11522) 2023-01-26 09:57:54 +08:00
chenjiahan
2ba59657e6 release: 4.0.9 2023-01-26 09:53:13 +08:00
neverland
9239aa184f
docs(Locale): add Esperanto to document (#11521) 2023-01-26 09:50:34 +08:00
etuardu
9257f3db92
feat(Locale): Add Esperanto translations (#11520) 2023-01-26 09:43:17 +08:00
etuardu
f565b45037
fix(Locale): it-IT.ts: general revision (#11519) 2023-01-26 09:39:51 +08:00
chenjiahan
25155c4465 release: @vant/area-data 1.4.0 2023-01-25 22:40:18 +08:00
neverland
c3d9cbfb1e
feat(Cascader): add useCascaderAreaData method (#11518) 2023-01-25 22:39:27 +08:00
neverland
816acf7886
feat(Locale): add useCurrentLang method (#11517) 2023-01-25 21:01:02 +08:00
neverland
769f16169e
feat(cli): increase document site padding (#11516) 2023-01-25 20:56:10 +08:00
neverland
a3aa1a34b3
feat(BackTop): add immediate prop (#11515)
* feat(BackTop): add immediate prop

* chore: update
2023-01-24 22:37:44 +08:00
neverland
3b060d7982
docs(BackTop): add click event document (#11514) 2023-01-24 22:23:11 +08:00
neverland
2cddef07c9
docs: add upgrade from v2 to v3 (#11513) 2023-01-23 21:38:44 +08:00
neverland
467a6a7cd3
docs: add en FAQ (#11512) 2023-01-23 21:29:08 +08:00
neverland
c2b20176d2
docs: delete out-dated style guide (#11511) 2023-01-23 21:17:27 +08:00
neverland
ccf7705ad3
docs: add contribution guide (#11510) 2023-01-23 21:15:39 +08:00
neverland
81dda09197
docs(Checkbox): add label-position demo (#11509) 2023-01-23 20:55:54 +08:00
neverland
93977e4160
docs: add upgrade from v3 to v4 (#11508) 2023-01-23 20:24:40 +08:00
chenjiahan
10758c123c fix(cli): mobile home desc line-height 2023-01-23 11:30:40 +08:00
neverland
b9a1ecafaa
docs: add english version of 4.0 release note (#11506) 2023-01-23 11:27:11 +08:00
neverland
46b23e4bad
feat(ImagePreview): add swipe when image is moved to edge (#11505) 2023-01-23 09:35:08 +08:00
neverland
7a42c9a616
fix(ImagePreview): disable zoom when swiping (#11504) 2023-01-22 20:37:10 +08:00
neverland
9306db90ca
fix(Swipe): avoid resetting position on multi-finger touch (#11503) 2023-01-22 20:24:09 +08:00
neverland
e75e680d9f
feat(Swipe): add drag-start, drag-end event (#11502) 2023-01-22 20:11:35 +08:00
neverland
1473a6e463
docs(Slider): fix reverse missing type (#11501) 2023-01-22 19:49:08 +08:00
neverland
f5a1a2c6b0
feat(Calendar): add month-title slot (#11500)
* feat(Calendar): add month-title slot

* chore: update snap

* chore: update snap
2023-01-21 23:03:36 +08:00
chenjiahan
c3735e7e7d release: create-vant-cli-app 2.1.2 2023-01-17 21:43:14 +08:00
谢俊
ff814475ca
fix(create-vant-cli-app): prompt config bug (#11497)
* fix(create-vant-cli-app): prompt config bug

* fix(create-vant-cli-app): prompt config bug

Co-authored-by: xiejun <jeff.xie@usmarthk.com>
2023-01-17 21:42:24 +08:00
neverland
711a131637
docs(changelog): vant@4.0.8 (#11490) 2023-01-15 11:15:08 +08:00
chenjiahan
6b01ba6d1a release: 4.0.8 2023-01-15 11:09:39 +08:00
neverland
b1b67015c3
fix(Picker): ensure title align in center (#11489) 2023-01-15 11:08:40 +08:00
neverland
a33610011a
chore(PickerGroup): remove redundant attrs (#11488) 2023-01-15 11:01:09 +08:00
neverland
f5f4ae6997
feat(PickerGroup): add next-step-text prop (#11487) 2023-01-15 10:53:00 +08:00
neverland
082a596568
docs(PickerGroup): fix missing tabs prop (#11486) 2023-01-15 10:14:25 +08:00
chenjiahan
2dcb4e39b1 docs(changelog): @vant/icons@2.0.1 2023-01-14 21:58:38 +08:00
chenjiahan
892e69a8a8 release: @vant/icons 2.0.1 2023-01-14 21:56:33 +08:00
neverland
2ffdbcdef2
fix(Icons): add woff format to compat some special webview (#11485) 2023-01-14 21:55:43 +08:00
wChenonly
13629b2070
fix(doc): sidebar covers nav when scrolling (#11468) 2023-01-14 21:50:07 +08:00
neverland
92d622aa82
chore: bump rimraf v4 (#11484) 2023-01-14 15:55:05 +08:00
Gavin
b04a50e70e
fix: change some colors to primary color (#11479) 2023-01-14 14:16:54 +08:00
哭你几哇
7418333d80
fix(Skeleton): can not register skeleton image component (#11470)
* fix(Skeleton): can not register skeleton image component by default #11469

* chore(skeleton-avatar): migrate skeleton avatar to new folder

* chore: remove duplicate types

* chore(skeleton-image): migrate skeleton image to new folder

* chore(skeleton-paragraph): migrate skeleton paragraph to new folder

* chore(skeleton-title): migrate skeleton title to new folder
2023-01-14 13:40:01 +08:00
chenjiahan
fa25677e19 release: create-vant-cli-app 2.1.1 2023-01-14 13:37:23 +08:00
要啥自行车
9d3f100ae9
fix(create-vant-cli-app): fix .gitignore template (#11478) 2023-01-14 13:33:57 +08:00
neverland
f32e3d9990
chore(eslint-config): bump deps version (#11465) 2023-01-07 21:56:49 +08:00
neverland
58fe29a611
docs(changelog): @vant/use@1.4.4 (#11464) 2023-01-07 17:29:20 +08:00
chenjiahan
c76d52b5fb release: @vant/use 1.4.4 2023-01-07 17:01:14 +08:00
neverland
12e0935948
docs(ConfigProvider): make theme vars reactive (#11463) 2023-01-07 17:00:33 +08:00
neverland
307b586d49
fix(Tabs): incorrect insert position in some cases (#11462) 2023-01-07 16:59:52 +08:00
neverland
609ec4579b
docs(changelog): vant@4.0.7 (#11445) 2023-01-02 12:38:13 +08:00
chenjiahan
228a80f2ad release: 4.0.7 2023-01-02 12:35:12 +08:00
neverland
aa7cd12fcf
docs(Popup): add events demo (#11444) 2023-01-02 12:33:51 +08:00
neverland
4e3c32bc2b
docs(Popup): improve position document (#11443) 2023-01-02 10:52:53 +08:00
chenjiahan
3f882bda96 docs(changelog): @vant/icons@2.0.0 2023-01-01 11:04:58 +08:00
chenjiahan
63254db3c0 release: @vant/icons 2.0.0 2023-01-01 11:03:46 +08:00
neverland
9a3b092f12
fix(Icons): no longer support woff/ttf format (#11442) 2023-01-01 11:02:27 +08:00
neverland
1e2b4953e7
fix(Icons): fix delete / delete-o icon (#11441) 2023-01-01 10:54:40 +08:00
neverland
5bd6997d3c
chore: add prefix of node core modules (#11440) 2022-12-31 20:27:35 +08:00
neverland
65d6a22f03
chore: bump Node.js v18 (#11439) 2022-12-31 20:19:11 +08:00
neverland
254b77b1a0
chore(cli): bump execa v6 (#11438) 2022-12-31 10:23:22 +08:00
neverland
2c4b599138
fix(Swipe): failed to render inside keep-alive (#11437) 2022-12-31 10:14:35 +08:00
neverland
670efb16f9
fix(cli): demo keep-alive not work (#11436) 2022-12-31 10:03:44 +08:00
Jungzl
1eea4fcd53
docs(ConfigProvider): fix how to override basic css variables (#11434)
* docs(ConfigProvider): fix how to override basic css variables

* docs(ConfigProvider): add notes about two `:root` selectors
2022-12-29 19:33:10 +08:00
MrXwq
53ec8a91a1
fix(image-preview):fix image-preview README、supplement teleport (#11429)
Co-authored-by: xuwenqiang <xuwenqiang@kanzhun.com>
2022-12-28 18:23:28 +08:00
neverland
9b00eb271c
chore: using enquirer to replace inquirer (#11426) 2022-12-27 16:33:39 +08:00
Tema Smirnov
db82d2b6f5
fix(Locale): ru-RU: fix typo of "Calendar" (#11425) 2022-12-26 09:53:26 +08:00
neverland
7eabcb85e1
docs(changelog): vant@4.0.6 (#11424) 2022-12-26 09:37:16 +08:00
chenjiahan
871a3f0119 release: 4.0.6 2022-12-26 09:34:38 +08:00
neverland
2d9148d5d7
fix(cli): should not empty out dir (#11423) 2022-12-26 09:33:36 +08:00
neverland
c6f1d99318
docs(changelog): vant@4.0.5 (#11420) 2022-12-25 21:21:14 +08:00
chenjiahan
be50698ebc release: 4.0.5 2022-12-25 21:13:55 +08:00
neverland
80f2134188
feat(Locale): add Dutch lang (#11419) 2022-12-25 21:08:01 +08:00
neverland
879133e7ee
feat(Locale): add mongolian lang (#11418) 2022-12-25 20:50:26 +08:00
neverland
e3c7e331f7
perf(cli): remove vite-plugin-html (#11416) 2022-12-24 16:31:26 +08:00
neverland
c02ad9ce07
fix(cli): remove docsearch (#11415)
* fix(cli): remove docsearch

* chore: remove react

* docs: add changelog
2022-12-24 15:55:36 +08:00
neverland
816a7cbdfb
feat(cli): bump vite v4 (#11414)
* feat(cli): bump vite v4

* chore: bump vite plugin
2022-12-24 15:47:15 +08:00
neverland
775d9539cc
chore(Badge): add some test cases for offset prop (#11412) 2022-12-24 15:33:58 +08:00
Gavin
78847b8375
fix(Badge): fix badge offset of different position (#11400)
* fix(Badge): fix badge offset of different position

* perf: improve code
2022-12-24 12:54:40 +08:00
HaiWei Lian
e39f0c67d1
fix(Picker): picker loading color in dark theme (#11405) 2022-12-23 18:14:25 +08:00
Jungzl
cd64c47259
fix(Form): filter no name field's value (#11410) 2022-12-23 18:13:10 +08:00
Gavin
f71336e256
docs: update contribution guide (#11409) 2022-12-23 18:12:33 +08:00
neverland
9b3a473061
docs(changelog): 4.0.4 (#11407) 2022-12-23 11:14:56 +08:00
chenjiahan
5bcae75f08 release: 4.0.4 2022-12-23 11:12:20 +08:00
neverland
0ee41a41a9
fix(Image): load event missing params (#11406) 2022-12-23 11:07:40 +08:00
HaiWei Lian
8043a9e0fe
docs: fix picker typo (#11404) 2022-12-22 18:16:45 +08:00
Ryan
589b7b2998
fix: readme document errors (#11401) 2022-12-21 13:59:30 +08:00
wnx
481298f279 fix(Field): incorrect cursor position when value length exceeds maxlength or when formatter is used (#11360) 2022-12-18 10:30:54 +08:00
neverland
bd3e7cc3f2
docs: remove CI status badge (#11392) 2022-12-17 11:59:02 +08:00
Gavin
28241c08e5
fix: replace value with title of Cell prop (#11384) 2022-12-14 10:13:38 +08:00
chenjiahan
ba3a50383c docs(changelog): vant@4.0.3 2022-12-13 10:29:00 +08:00
chenjiahan
c68db1cf61 release: 4.0.3 2022-12-13 10:27:43 +08:00
Gavin
851c967ad9
fix(ImagePreview): fix loading when previewing images (#11376) 2022-12-13 10:26:22 +08:00
neverland
7f834d57eb
fix(Field): failed to dynamically set empty label (#11373) 2022-12-10 21:00:36 +08:00
Aresn
7a740a45d5
docs: add Cloud IDE preview online (#11362)
* Create preview.yml

* Add Cloud IDE link

* Add Cloud IDE link

* Update README.md
2022-12-07 10:56:24 +08:00
chenjiahan
7c35b143dd docs: update release note link 2022-12-04 17:54:32 +08:00
neverland
6f526d3024
docs: add 4.0 release note (#11355) 2022-12-04 16:40:59 +08:00
neverland
d0e0e97e99
docs(changelog): vant@4.0.2 (#11353) 2022-12-03 20:32:03 +08:00
chenjiahan
74950c68ee release: 4.0.2 2022-12-03 20:29:35 +08:00
chenjiahan
54ce702f31 chore: upgrade pnpm to 7.17.1 2022-12-03 20:28:04 +08:00
chenjiahan
87a9272ece fix(Image): avoid duplicate load event 2022-12-03 20:23:17 +08:00
chenjiahan
128972a753 fix(Image): load event not triggered in nuxt3 2022-12-03 20:18:01 +08:00
neverland
2c30e7ba68
fix(NavBar): update placeholder height when window resized (#11351) 2022-12-03 20:01:12 +08:00
Gavin
7919ea2b8b
fix: fix copying errors of icon demo (#11350) 2022-12-03 19:41:20 +08:00
neverland
67a3a507ac
fix(Field): incorrect cursor position when using formatter (#11348) 2022-12-02 19:17:45 +08:00
neverland
720de45350
docs: update area data links (#11343) 2022-12-02 09:43:23 +08:00
zhouronghua
6ee791a64c
chore: adjust extend method import path (#11341)
Co-authored-by: zhouronghua <zhouronghua01@qq.com>
2022-12-02 09:35:47 +08:00
neverland
49336932ed
docs(changelog): vant@4.0.1 (#11339) 2022-12-01 17:50:30 +08:00
chenjiahan
46191d631e release: 4.0.1 2022-12-01 17:48:15 +08:00
Mikasa33
36269ac9ec
docs(Dialog): fix the min version of footer slot (#11336) 2022-12-01 12:46:21 +08:00
Gavin
b423decad0
feat(Picker): add selectedIndexes to the confirm event (#11329) 2022-11-30 21:38:43 +08:00
neverland
dde13fac3c
fix(Field): set selection range only when focused (#11333) 2022-11-30 21:36:57 +08:00
xujintai123
4e9d830dbf
docs: remove unnecessary code example (#11321) 2022-11-28 17:17:23 +08:00
neverland
cdfcf01687
docs: add install step to migration guide (#11319) 2022-11-27 13:32:25 +08:00
neverland
c81e967188
docs: update CDN link to v4 (#11318) 2022-11-27 12:16:51 +08:00
neverland
da75691371
docs(changelog): 4.0.0 (#11317) 2022-11-26 23:03:05 +08:00
chenjiahan
05968e953d release: 4.0.0 2022-11-26 22:55:46 +08:00
neverland
7858537434
docs: adjust v4 site deploy config (#11316) 2022-11-26 22:54:23 +08:00
neverland
13512ca25b
docs: add maintenance status table (#11315) 2022-11-26 22:50:02 +08:00
neverland
4105da6796
feat(BackTop): allow using css var to custom position (#11312) 2022-11-26 21:34:49 +08:00
neverland
1b876d85d1
feat(BackTop): allow dynamically set target prop (#11311) 2022-11-26 21:15:41 +08:00
neverland
41f35b2735
chore(BackTop): only print error msg in development (#11310) 2022-11-26 21:06:20 +08:00
neverland
a318807eb5
fix(BackTop): rename visibility-height prop to offset (#11309) 2022-11-26 21:01:59 +08:00
neverland
7042d1c06e
fix(Field): keep selection position after updating value (#11308) 2022-11-26 20:17:51 +08:00
neverland
d227429fdc
feat(List): add disabled prop (#11307) 2022-11-26 20:05:33 +08:00
Jiang Menghao
69b5ea6348
fix(Dialog): fix dialog docs typo (#11296) 2022-11-25 11:56:30 +08:00
neverland
a0371ed791
docs(changelog): 4.0.0-rc.9 (#11292) 2022-11-24 15:16:56 +08:00
chenjiahan
ecfd3097eb release: 4.0.0-rc.9 2022-11-24 15:10:32 +08:00
neverland
93a972bd51
docs: improve blockquote style (#11291) 2022-11-24 14:55:45 +08:00
neverland
d1746c9d81
docs: update area data guide (#11290) 2022-11-24 14:53:10 +08:00
neverland
44704783f1
fix(style): body normalize not work (#11287) 2022-11-24 11:19:45 +08:00
Tsdy
87ee32241a fix(Cell): arrow-direction assignment right is invalid (#11279) 2022-11-21 10:23:05 +08:00
neverland
e609a3d954
docs(changelog): 4.0.0-rc.8 (#11276) 2022-11-20 16:25:47 +08:00
chenjiahan
c3535b6c82 release: 4.0.0-rc.8 2022-11-20 16:22:00 +08:00
neverland
3c6795ec51
fix(List): incorrect initial loading value (#11275) 2022-11-19 18:51:56 +08:00
neverland
eb0f535dac
fix(NumberKeyboard): should inherit attrs when using teleport (#11274) 2022-11-19 18:45:10 +08:00
neverland
14cf68be1e
fix(DropdownItem): should inherit attrs when using teleport (#11273)
* fix(DropdownItem): should inherit attrs when using teleport

* chore: update lock file

* chore: update snapshot
2022-11-19 17:24:56 +08:00
neverland
0472b10310
docs(BackTop): update demo and document (#11272) 2022-11-19 16:32:54 +08:00
neverland
e50966ecdf
feat(BackTop): allow to set position with other units (#11270) 2022-11-19 15:43:43 +08:00
neverland
5bbdb0f40c
fix(BackTop): failed to get element ref (#11269) 2022-11-19 11:14:03 +08:00
Gavin
5cf4322143
feat(BackTop): new component (#11236)
* feat(BackTop): new component

* perf(BackTop): perf BackTop component

* perf(BackTop): improve code

* perf: improve type
2022-11-19 10:14:39 +08:00
neverland
e19e982292
docs(changelog): 4.0.0-rc.7 (#11253) 2022-11-13 22:26:42 +08:00
chenjiahan
5a38c73b77 release: 4.0.0-rc.7 2022-11-13 22:21:16 +08:00
neverland
093db7b37e
feat(ImagePreview): add long-press event (#11252)
* feat(ImagePreview): add long-press event

* chore: upd

* chore: upd

* chore: upd
2022-11-13 11:42:26 +08:00
neverland
839bcd8928
docs: add unplugin-vue-components tip (#11251) 2022-11-13 10:46:49 +08:00
neverland
1f917e9a2a
fix(Picker): empty column will cause error (#11249) 2022-11-13 10:26:41 +08:00
neverland
83dcbe6f5f
fix(DatePicker): only throw error in development (#11248) 2022-11-13 09:22:48 +08:00
neverland
e6c6265e69
fix(Skeleton): incorrect export component name (#11247)
* fix(Skeleton): incorrect export component name

* chore: fix name
2022-11-13 09:21:05 +08:00
neverland
80270138e1
test: attach demo to body (#11246) 2022-11-12 18:20:03 +08:00
neverland
9b513311c2
docs(Popover): fix placement demo (#11245) 2022-11-12 13:23:44 +08:00
neverland
4e9c301012
feat(Popover): support uncontrolled mode (#11244) 2022-11-12 13:14:58 +08:00
若川
f071e48be2
fix(lazyload): lazy-image h is not a function (#11229)
in vue 3.x h is not function. this.$slots.default is  a function.

[vue 3.x refs render-function-api-change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md)
[vue 3.x 文档 h 渲染函数](https://cn.vuejs.org/api/render-function.html#h)
2022-11-08 10:16:20 +08:00
neverland
842c92d3c9
perf(@vant/cli): generate smaller web-types.json (#11226) 2022-11-05 22:13:06 +08:00
neverland
8dcfb5c29a
fix(Skeleton): round prop not work for title (#11225) 2022-11-05 21:38:15 +08:00
哭你几哇
19cd0667e4
feat(skeleton-item): add skeleton-item component (#11173)
* feat(skeleton-item): add skeleton-item component

* docs(Skeleton): update docs

* feat(Skeleton): add skeleton title avatar paragraph image componets

* chore: add uncommit files

* test(Skeleton): fix skeleton test case failed

* feat(Skeleton-Image): add skeleton-image style

* test(Skeleton): fix failed test case

* docs(Skeleton): update skeleton docs

* fix(Skeleton): add skeleton image theme vars

* perf(Skeleton): use Icon componet in Skeleton image to reduce bundle size

* docs(Skeleton): update skeleton docs

* docs(Skeleton): fix wrong component name
2022-11-05 21:17:23 +08:00
neverland
3991f27a02
docs(changelog): @vant/cli@5.1.0 (#11224) 2022-11-05 20:42:44 +08:00
chenjiahan
7c1ce45db8 release: @vant/cli 5.1.0 2022-11-05 20:40:28 +08:00
neverland
fe07c10729
feat(cli): support vite.config.ts (#11223) 2022-11-05 20:39:51 +08:00
neverland
d9fe675af4
feat(cli): allow to custom server.port (#11222) 2022-11-05 20:03:58 +08:00
Gavin
cedbc089b4
fix(ActionSheet): fix that close is invalid without title (#11213) 2022-11-03 21:53:38 +08:00
Gavin
20f940d6a4
fix(Uploader): chooseFile is invalid when show-upload = false (#11218) 2022-11-03 21:49:16 +08:00
neverland
45f7adc701
docs: improve migration guide (#11196) 2022-10-30 20:40:10 +08:00
neverland
3faf04c02e
docs: add docs for builtin classes (#11195) 2022-10-30 20:17:36 +08:00
neverland
5d98d5a5d4
fix(Picker): correct v-model when emit confirm event (#11194) 2022-10-29 21:55:00 +08:00
EmberSpirit
73b4210118
docs(Form): fix form docs code (#11178) 2022-10-26 16:25:15 +08:00
neverland
22f832342a
docs(changelog): vant@4.0.0-rc.6 (#11169) 2022-10-23 23:07:31 +08:00
chenjiahan
59433115d9 release: 4.0.0-rc.6 2022-10-23 23:04:22 +08:00
neverland
6848550243
feat(Calendar): add params for subtitle slot (#11168)
* feat(Calendar): add params for subtitle slot

* chore: fix
2022-10-23 22:47:33 +08:00
neverland
859e5ee32c
fix(Swipe): failed to render when inside popup (#11162)
* fix(Swipe): failed to render when inside popup

* chore: upd
2022-10-22 22:58:42 +08:00
neverland
ff34eb73fd
chore: bump vite to v3.1.8 (#11161) 2022-10-22 22:25:41 +08:00
neverland
2c704dd0bf
chore: add nvmrc and engines of pnpm (#11157) 2022-10-21 09:15:04 +08:00
neverland
882bfb3924
docs(Toast): add word-break demo (#11156) 2022-10-20 22:33:37 +08:00
neverland
299b558439
fix(Coupon): incorrect field style (#11155) 2022-10-20 16:41:42 +08:00
Gavin
c6a6b5fe17
style(Coupon): fix the style of coupon checkbox (#11153) 2022-10-20 16:37:57 +08:00
Gavin
d2abde3fbd
docs(Field): fix field docs typo (#11152) 2022-10-20 10:20:44 +08:00
Gavin
c98f3e19c9
feat(Toast): add wordBreak prop (#11147) 2022-10-19 10:08:57 +08:00
neverland
2729ebff85
feat(Cell): add tag prop (#11139) 2022-10-16 10:32:57 +08:00
neverland
564d751fd8 docs(ImagePreview): improve document (#11137) 2022-10-15 23:01:50 +08:00
uniquker
1f77796bad feat(ImagePreview): add preview image slot (#11133) 2022-10-15 23:00:48 +08:00
neverland
e1d24caa98
docs(TreeSelect): make document consistent with demo (#11136) 2022-10-15 20:46:45 +08:00
neverland
922872522e
docs(changelog): vant@4.0.0-rc.5 (#11125) 2022-10-07 23:35:26 +08:00
chenjiahan
bbb6a6ef2a release: 4.0.0-rc.5 2022-10-07 23:32:35 +08:00
neverland
9c6b416bfb
test(DatePicker): migrate legacy test cases (#11123) 2022-10-07 23:24:03 +08:00
neverland
baa9c33dd4
fix(DatePicker): format value when exceed max date (#11122) 2022-10-07 23:04:56 +08:00
neverland
137a1b9cb7
docs(Field): add label-align demo (#11121) 2022-10-07 10:26:27 +08:00
chenjiahan
d49c1fb94a release: @vant/cli 5.0.2 2022-10-07 10:09:33 +08:00
neverland
2d981afde2
fix(cli): duplicate vue in first dev (#11120)
* fix(cli): duplicate vue in first dev

* docs: add changelog
2022-10-07 10:08:46 +08:00
neverland
19ce1d205d
feat(cli): using @vant/cli v5 in template (#11119) 2022-10-07 10:03:11 +08:00
neverland
9a95275cf1
docs(changelog): @vant/cli 5.0.1 (#11118) 2022-10-06 17:04:50 +08:00
chenjiahan
843c167376 release: @vant/cli 5.0.1 2022-10-06 17:03:15 +08:00
neverland
711652ad90
feat(cli): bump jest v29 (#11117) 2022-10-06 17:01:29 +08:00
neverland
f94897cb24
fix(Tabs): incorrect nav scroll animation in some cases (#11116)
* fix(Tabs): incorrect nav scroll animation in some cases

* chore: fix snapshot
2022-10-06 16:23:05 +08:00
neverland
d60096aff2
fix(Tabs): scroll position when using nav-bottom slot (#11115) 2022-10-06 16:07:12 +08:00
neverland
3d7ca9b490
docs: add faq of uni-app (#11114) 2022-10-05 09:28:28 +08:00
neverland
ef80a72e58
fix(Field): icon position when label align is top (#11112) 2022-10-04 09:21:45 +08:00
sunhao
ee923beecf
feat: add label-position:top for field and form (#11102)
Co-authored-by: redsun1992 <sunhao@starwrap.net>
2022-10-04 09:01:14 +08:00
neverland
b61158aaee
perf(cli): code split documents (#11111) 2022-10-04 08:47:43 +08:00
neverland
9d55f2d6b8
docs(Navbar): update clickable description (#11110) 2022-10-03 21:47:42 +08:00
哭你几哇
ea0ba1fcf1
feat(nav-bar): add clickable prop to nav-bar component (#11048)
* feat: add clickable prop to nav-bar

* test(nav-bar): add clickable prop test case
2022-10-03 21:43:32 +08:00
neverland
9f2eb92172
feat(Loading): add icon slot (#11109)
* feat(Loading): add icon slot

* chore: update snapshot
2022-10-03 21:36:02 +08:00
Gavin
59d5d76dbe
feat(Stepper): add auto-fixed prop (#11071)
* perf: improve the type of setTimeout with 'ReturnType<typeof setTimeout>'

* fix: fix type 'number' is not assignable to type 'Timeout'

* feat: add 'auto-fixed' prop to control whether to fixed the value that out of rang

* docs(Stepper): fix prop name

* perf: whether to format the value entered by the user
2022-09-28 22:02:32 +08:00
neverland
a1c859dc10 docs: fix website redirect (#11097) 2022-09-28 21:54:35 +08:00
neverland
f90a2f1611
docs(changelog): vant@4.0.0-rc.4 (#11088) 2022-09-25 16:06:47 +08:00
chenjiahan
6d2705f578 release: 4.0.0-rc.4 2022-09-25 16:04:32 +08:00
neverland
7e482c059b
fix(cli): downgrade vite version to fix the website (#11087) 2022-09-25 16:02:17 +08:00
neverland
2a66e7c9ea fix(Tabs): incorrect scroll position in some cases (#11085) 2022-09-24 23:00:19 +08:00
neverland
64af9ffd6f
chore(cli): bump esbuild@0.15 (#11084) 2022-09-24 20:38:27 +08:00
chenjiahan
0a75e92349 chore: fix build branch of website 2022-09-24 20:28:21 +08:00
chenjiahan
20310110e3 chore: fix github-pages-deploy-action version 2022-09-24 11:45:46 +08:00
chenjiahan
9ce2d0753f chore: fix duplicate branches 2022-09-24 11:43:45 +08:00
neverland
070431bef2
chore: update action for deploy website (#11083) 2022-09-24 11:42:31 +08:00
neverland
febb0a8a1b
release: @vant/cli 5.0.0-beta.0 (#11082) 2022-09-24 10:50:33 +08:00
Gavin
ece27f9474
feat(Field): add message param to 'end-validate' method (#11080) 2022-09-24 10:44:48 +08:00
neverland
0ceb6a843c
release: vant@1.4.3 (#11076) 2022-09-22 23:18:05 +08:00
neverland
980ab88c2e
perf: move @vant/icons to dev dependencies (#11075) 2022-09-22 23:08:51 +08:00
Gavin
e0063ae249
perf: improve the type of setTimeout (#11069)
* perf: improve the type of setTimeout with 'ReturnType<typeof setTimeout>'

* fix: fix type 'number' is not assignable to type 'Timeout'

Co-authored-by: wangjunwei <wangjunwei@nucarf.com>
2022-09-22 11:24:32 +08:00
neverland
ccd92a6eee fix(Tabs): incorrect scroll position when inited (#11059) 2022-09-18 22:06:59 +08:00
Reii
e250dd31b8
docs(PickerGroup): fix TimePicker link error (#11053) 2022-09-16 14:35:21 +08:00
Reii
282021de4e
docs(Cascader): update field-names type (#11052) 2022-09-16 13:01:22 +08:00
neverland
82883141a1
chore: rename main branch from dev to main (#11042) 2022-09-12 11:34:29 +08:00
neverland
a635e2d80b
docs: update links (#11041) 2022-09-12 11:27:14 +08:00
neverland
1d2e983a0f
docs: improve dark theme guide (#11040) 2022-09-12 11:16:11 +08:00
neverland
cbbdad909a
fix(cli): should remove light theme class in dark mode (#11039) 2022-09-12 11:05:44 +08:00
neverland
6a9d5515ce
docs(changelog): vant@4.0.0-rc.3 (#11038) 2022-09-12 10:54:15 +08:00
chenjiahan
5509ca0d1d release: 4.0.0-rc.3 2022-09-12 10:47:26 +08:00
neverland
65d9fbc5da
types: some theme vars can be number type (#11037) 2022-09-12 10:44:53 +08:00
neverland
39a100f3a0
feat: add themeVars type of all components (#11034)
* types: add types of all theme vars

* types: export all theme vars

* types: add ConfigProviderThemeVars

* fix: repeat key

* docs: add doc
2022-09-12 10:37:24 +08:00
neverland
e1670e27f6
types(Toast): fix missing global components type (#11033) 2022-09-11 23:00:05 +08:00
neverland
b29180933b
feat(Notify): add z-index prop (#11032) 2022-09-11 22:56:15 +08:00
neverland
97d02a1e92
docs: fix missing z-index prop in document (#11031) 2022-09-11 22:53:43 +08:00
chenjiahan
16c1f35135 release: @vant/popperjs 1.3.0 2022-09-11 16:49:56 +08:00
neverland
9cd60d151d
perf: remove popperjs to reduce install size (#11030) 2022-09-11 16:41:54 +08:00
neverland
ee6fa66e4a
docs(changelog): vant@4.0.0-rc.2 (#11029) 2022-09-11 12:08:32 +08:00
chenjiahan
bcae14d7cb release: 4.0.0-rc.2 2022-09-11 12:05:14 +08:00
neverland
4756168ae7
fix(Dialog): incorrect transform behavior (#11028) 2022-09-11 09:43:49 +08:00
neverland
fd9cf38022
style(Empty): fix opacity in dark mode (#11027) 2022-09-11 09:21:09 +08:00
neverland
34360abd3b
fix: attach css variables to :root element (#11026) 2022-09-11 09:11:53 +08:00
chenjiahan
b6f2eb3e2a docs: fix legacy css variables in demo 2022-09-10 22:43:56 +08:00
chenjiahan
845c0b720b chore: remove unused stylelint ignore 2022-09-10 22:07:20 +08:00
neverland
c243ebd1ff
docs(changelog): vant@4.0.0-rc.1 (#11025) 2022-09-10 22:06:33 +08:00
chenjiahan
09c2bd8efd release: 4.0.0-rc.1 2022-09-10 22:02:49 +08:00
neverland
8df6eaf5a0
Merge pull request #10208 from vant-ui/next
WIP: 4.0
2022-09-10 21:55:57 +08:00
chenjiahan
99833f2185 docs: switch dev branch to v4 2022-09-10 21:53:14 +08:00
923 changed files with 57802 additions and 6476 deletions

View File

@ -1 +1,8 @@
blank_issues_enabled: true blank_issues_enabled: true
contact_links:
- name: Ask a question
url: https://github.com/youzan/vant/discussions
about: Ask a question about Vant
- name: 提问
url: https://github.com/youzan/vant/discussions
about: 询问 Vant 的用法问题

View File

@ -1,6 +1,6 @@
### Before submitting a pull request, please make sure the following is done: ### Before submitting a pull request, please make sure the following is done:
1. Read the [contributing guide](https://github.com/vant-ui/vant/blob/dev/.github/CONTRIBUTING.md). 1. Read the [contributing guide](https://github.com/vant-ui/vant/blob/main/.github/CONTRIBUTING.md).
2. If you've added code that should be tested, add tests. 2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation. 3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`npm test`). 4. Ensure the test suite passes (`npm test`).

View File

@ -13,10 +13,10 @@ name: "CodeQL"
on: on:
push: push:
branches: [ dev ] branches: [ main ]
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ dev ] branches: [ main ]
schedule: schedule:
- cron: '36 21 * * 2' - cron: '36 21 * * 2'

View File

@ -2,7 +2,7 @@ name: Deploy V4 Site
on: on:
push: push:
branches: [next] branches: [main]
paths: paths:
- 'packages/vant/docs/**' - 'packages/vant/docs/**'
@ -15,14 +15,14 @@ jobs:
- name: Checkout 🛎️ - name: Checkout 🛎️
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: 'next' ref: 'main'
- name: Install pnpm - name: Install pnpm
run: npm i pnpm@7 -g run: corepack enable
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: '16' node-version: '18'
cache: 'pnpm' cache: 'pnpm'
- name: Install dependencies - name: Install dependencies
@ -31,10 +31,49 @@ jobs:
- name: Build Site - name: Build Site
run: npm run build:site run: npm run build:site
- name: Deploy 🚀 - name: Deploy for Gitee 🚀
uses: JamesIves/github-pages-deploy-action@4.1.1 uses: JamesIves/github-pages-deploy-action@v4.4.0
with: with:
branch: gh-pages branch: gh-pages
folder: packages/vant/site-dist folder: packages/vant/site-dist
target-folder: v4 clean: true
clean: false clean-exclude: |
1.x/*
1.x/**/*
next/*
next/**/*
v1/*
v1/**/*
v2/*
v2/**/*
v3/*
v3/**/*
v4/*
v4/**/*
vant-use/*
vant-use/**/*
- name: Deploy for GitHub 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: main
folder: packages/vant/site-dist
token: ${{ secrets.VANT_UI_TOKEN }}
repository-name: vant-ui/vant-ui.github.io
target-folder: vant
clean: true
clean-exclude: |
1.x/*
1.x/**/*
next/*
next/**/*
v1/*
v1/**/*
v2/*
v2/**/*
v3/*
v3/**/*
v4/*
v4/**/*
vant-use/*
vant-use/**/*

View File

@ -0,0 +1,25 @@
name: Issue Close Require
on:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
issue-close-require:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: need reproduce
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
labels: 'need reproduce'
inactive-day: 3
body: |
Since the issue was labeled with `need reproduce`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要复现,却 3 天未收到回应。现关闭 issue若有任何问题可评论回复。

69
.github/workflows/issue-labeled.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: Issue Labeled
on:
issues:
types: [labeled]
permissions:
contents: read
jobs:
reply-labeled:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- name: help wanted
if: github.event.label.name == '👏 PR welcome' || github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to `main` branch, fill the [Pull Request Template](https://github.com/vant-ui/vant/blob/main/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到 `main` 分支,务必填写 Pull Request 内的[预设模板](https://github.com/vant-ui/vant/blob/main/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review提前感谢和期待您的贡献。
- name: need reproduce
if: github.event.label.name == 'need reproduce'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide an online reproduction demo by clicking this [link](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) or a minimal GitHub repository. Issues marked with `need reproduce` will be closed if they have no activity within 3 days.
你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。可以通过点击 [此处](https://codesandbox.io/s/vant-3-issue-template-8fuq5o) 创建或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。
- name: question
if: github.event.label.name == 'question'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment, close-issue'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Vant. So, please don't ask usage questions here. You can try to open a new discussion in [vant discussions](https://github.com/vant-ui/vant/discussions), select `Q&A` to ask questions.
你好 @${{ github.event.issue.user.login }}Vant Issue 板块是用于 bug 反馈与需求讨论的地方。请勿在这里询问如何使用等相关问题,你可以试着在 [vant discussions](https://github.com/vant-ui/vant/discussions) 新开一个 discussion选择 `Q&A` 类别进行提问。
- name: 2.x
if: github.event.label.name == '2.x'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment, close-issue'
issue-number: ${{ github.event.issue.number }}
body: |
Hi @${{ github.event.issue.user.login }}. Current version (2.x) is off the maintenance period. We will only fix critical bugs. This issue will be auto closed.
你好 @${{ github.event.issue.user.login }}当前版本2.x已经过了维护期。我们仅会修复重要 bug。当前 issue 会被自动关闭。
- name: invalid
if: github.event.label.name == 'invalid'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment, close-issue'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements.
你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。

View File

@ -2,7 +2,8 @@ name: Sync to Gitee
on: on:
push: push:
branches: [dev, 2.x, gh-pages] tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch: workflow_dispatch:

View File

@ -7,7 +7,7 @@ on:
pull_request: pull_request:
branches: branches:
- dev - main
workflow_dispatch: workflow_dispatch:
@ -18,11 +18,11 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install pnpm - name: Install pnpm
run: npm i pnpm@7 -g run: corepack enable
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: '16' node-version: '18'
cache: 'pnpm' cache: 'pnpm'
- name: Install dependencies - name: Install dependencies
@ -37,11 +37,11 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install pnpm - name: Install pnpm
run: npm i pnpm@7 -g run: corepack enable
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: '16' node-version: '18'
cache: 'pnpm' cache: 'pnpm'
- name: Install dependencies - name: Install dependencies
@ -61,11 +61,11 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install pnpm - name: Install pnpm
run: npm i pnpm@7 -g run: corepack enable
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: '16' node-version: '18'
cache: 'pnpm' cache: 'pnpm'
- name: Install dependencies - name: Install dependencies

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
lts/Hydrogen

View File

@ -4,14 +4,13 @@
<h1 align="center">Vant</h1> <h1 align="center">Vant</h1>
<p align="center">Lightweight Mobile UI Components built on Vue</p> <p align="center">A lightweight, customizable Vue UI library for mobile web apps.</p>
<p align="center"> <p align="center">
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" /> <img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" /> <img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" /> <img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
<img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" /> <img src="https://img.badgesize.io/https://unpkg.com/vant/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
</p> </p>
<p align="center"> <p align="center">
@ -34,12 +33,13 @@
- 📖 Extensive documentation and demos - 📖 Extensive documentation and demos
- 📖 Provide Sketch and Axure design resources - 📖 Provide Sketch and Axure design resources
- 🍭 Support Vue 2 & Vue 3 - 🍭 Support Vue 2 & Vue 3
- 🍭 Support Nuxt 2 & Nuxt 3, provide [Vant Module](https://github.com/vant-ui/vant-nuxt) for Nuxt
- 🍭 Support Tree Shaking - 🍭 Support Tree Shaking
- 🍭 Support Custom Theme - 🍭 Support Custom Theme
- 🍭 Support Accessibility (still improving) - 🍭 Support Accessibility (still improving)
- 🍭 Support Dark Mode (Requires upgrade to [Vant 4](https://vant-contrib.gitee.io/vant/v4/#/en-US/config-provider)) - 🍭 Support Dark Mode
- 🍭 Support SSR - 🍭 Support SSR
- 🌍 Support i18n, built-in 20+ languages - 🌍 Support i18n, built-in 30+ languages
## Install ## Install
@ -92,16 +92,16 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
| --- | --- | | --- | --- |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI | | [vant-weapp](https://github.com/vant-ui/vant-weapp) | WeChat MiniProgram UI |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos | | [vant-demo](https://github.com/vant-ui/vant-demo) | Collection of Vant demos |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library | | [vant-cli](https://github.com/vant-ui/vant/tree/main/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons | | [vant-icons](https://github.com/vant-ui/vant/tree/main/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers | | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/main/packages/vant-touch-emulator) | Using vant in desktop browsers |
| [vant-nuxt](https://github.com/vant-ui/vant-nuxt) | Vant module for Nuxt |
## Community Ecosystem ## Community Ecosystem
| Project | Description | | Project | Description |
| --- | --- | | --- | --- |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components based on Vant | | [3lang3/react-vant](https://github.com/3lang3/react-vant) | React mobile UI Components based on Vant |
| [rc-ui-lib](https://github.com/rancui/rc-ui-lib) | React mobile UI Components based on Vant |
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Alipay MiniProgram UI | | [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Alipay MiniProgram UI |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro | | [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI | | [vant-theme](https://github.com/Aisen60/vant-theme) | Online theme preview built on Vant UI |
@ -112,7 +112,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
- [Documentation](https://vant-ui.github.io/vant) - [Documentation](https://vant-ui.github.io/vant)
- [Changelog](https://vant-ui.github.io/vant#/en-US/changelog) - [Changelog](https://vant-ui.github.io/vant#/en-US/changelog)
- [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link) - [Discussions](https://github.com/vant-ui/vant/discussions)
## Preview ## Preview
@ -124,9 +124,13 @@ You can scan the following QR code to access the demo
Core contributors of Vant and Vant Weapp: Core contributors of Vant and Vant Weapp:
| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | | [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) |
| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| [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://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![JakeLaoyu](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | [![landluck](https://avatars.githubusercontent.com/u/27060081?s=80&v=4)](https://github.com/landluck/) | [![wjw-gavin](https://avatars.githubusercontent.com/u/19986739?s=80&v=4)](https://github.com/wjw-gavin/) |
| :-: | :-: | :-: | :-: | :-: |
| [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | [landluck](https://github.com/landluck/) | [wjw-gavin](https://github.com/wjw-gavin/) |
## All Contributors ## All Contributors
@ -140,6 +144,10 @@ Thanks to the following friends for their contributions to Vant:
Please make sure to read the [Contributing Guide](./.github/CONTRIBUTING.md) before making a pull request. Please make sure to read the [Contributing Guide](./.github/CONTRIBUTING.md) before making a pull request.
## Start On Web IDE
[https://github.dev/youzan/vant](https://github.dev/youzan/vant)
## LICENSE ## LICENSE
[MIT](https://en.wikipedia.org/wiki/MIT_License) Vant is [MIT](https://github.com/youzan/vant/blob/main/LICENSE) licensed.

View File

@ -4,14 +4,13 @@
<h1 align="center">Vant</h1> <h1 align="center">Vant</h1>
<p align="center">轻量、可的移动端 Vue 组件库</p> <p align="center">轻量、可定制的移动端 Vue 组件库</p>
<p align="center"> <p align="center">
<img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" /> <img src="https://img.shields.io/npm/v/vant?style=flat-square" alt="npm version" />
<img src="https://img.shields.io/github/workflow/status/vant-ui/vant/CI/dev?style=flat-square" alt="CI Status" />
<img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" /> <img src="https://img.shields.io/codecov/c/github/vant-ui/vant/dev.svg?style=flat-square&color=#4fc08d" alt="Coverage Status" />
<img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" /> <img src="https://img.shields.io/npm/dm/vant.svg?style=flat-square&color=#4fc08d" alt="downloads" />
<img src="https://img.badgesize.io/https://unpkg.com/vant@3/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" /> <img src="https://img.badgesize.io/https://unpkg.com/vant/lib/vant.min.js?compression=gzip&style=flat-square&label=gzip%20size&color=#4fc08d" alt="Gzip Size" />
</p> </p>
<p align="center"> <p align="center">
@ -24,7 +23,7 @@
### 介绍 ### 介绍
Vant 是一个**轻量、可的移动端组件库**,于 2017 年开源。 Vant 是一个**轻量、可定制的移动端组件库**,于 2017 年开源。
目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。 目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
@ -38,12 +37,13 @@ Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
- 📖 提供丰富的中英文文档和组件示例 - 📖 提供丰富的中英文文档和组件示例
- 📖 提供 Sketch 和 Axure 设计资源 - 📖 提供 Sketch 和 Axure 设计资源
- 🍭 支持 Vue 2、Vue 3 和微信小程序 - 🍭 支持 Vue 2、Vue 3 和微信小程序
- 🍭 支持 Nuxt 2、Nuxt 3提供 Nuxt 的 [Vant Module](https://github.com/vant-ui/vant-nuxt)
- 🍭 支持主题定制,内置 700+ 个主题变量 - 🍭 支持主题定制,内置 700+ 个主题变量
- 🍭 支持按需引入和 Tree Shaking - 🍭 支持按需引入和 Tree Shaking
- 🍭 支持无障碍访问(持续改进中) - 🍭 支持无障碍访问(持续改进中)
- 🍭 支持深色模式(从 [Vant 4](https://vant-contrib.gitee.io/vant/v4/#/zh-CN/config-provider) 开始支持) - 🍭 支持深色模式
- 🍭 支持服务器端渲染 - 🍭 支持服务器端渲染
- 🌍 支持国际化,内置 20+ 种语言包 - 🌍 支持国际化,内置 30+ 种语言包
## 安装 ## 安装
@ -98,9 +98,10 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| --- | --- | | --- | --- |
| [vant-weapp](https://github.com/vant-ui/vant-weapp) | Vant 微信小程序版 | | [vant-weapp](https://github.com/vant-ui/vant-weapp) | Vant 微信小程序版 |
| [vant-demo](https://github.com/vant-ui/vant-demo) | Vant 官方示例合集 | | [vant-demo](https://github.com/vant-ui/vant-demo) | Vant 官方示例合集 |
| [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 | | [vant-cli](https://github.com/vant-ui/vant/tree/main/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant 图标库 | | [vant-icons](https://github.com/vant-ui/vant/tree/main/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 | | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/main/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
| [vant-nuxt](https://github.com/vant-ui/vant-nuxt) | 为 Nuxt 准备的模块 |
## 社区生态 ## 社区生态
@ -109,7 +110,6 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 | | 项目 | 描述 |
| --- | --- | | --- | --- |
| [3lang3/react-vant](https://github.com/3lang3/react-vant) | 参照 Vant 打造的 React 框架移动端组件库 | | [3lang3/react-vant](https://github.com/3lang3/react-vant) | 参照 Vant 打造的 React 框架移动端组件库 |
| [rc-ui-lib](https://github.com/rancui/rc-ui-lib) | 参照 Vant 打造的 React 框架移动端组件库 |
| [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Vant 支付宝小程序版 | | [vant-aliapp](https://github.com/ant-move/Vant-Aliapp) | Vant 支付宝小程序版 |
| [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro 版 | | [taroify](https://gitee.com/mallfoundry/taroify) | Vant Taro 版 |
| [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 | | [vant-theme](https://github.com/Aisen60/vant-theme) | Vant 在线主题预览工具 |
@ -120,7 +120,8 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
- [详细文档](https://vant-contrib.gitee.io/vant) - [详细文档](https://vant-contrib.gitee.io/vant)
- [更新日志](https://vant-contrib.gitee.io/vant#/zh-CN/changelog) - [更新日志](https://vant-contrib.gitee.io/vant#/zh-CN/changelog)
- [Gitter 讨论组](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link) - [码云镜像仓库](https://gitee.com/vant-contrib/vant)
- [Discussions 讨论区](https://github.com/vant-ui/vant/discussions)
## 手机预览 ## 手机预览
@ -132,9 +133,13 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
以下是 Vant 和 Vant Weapp 的核心贡献者们: 以下是 Vant 和 Vant Weapp 的核心贡献者们:
| [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) | [![nemo-shen](https://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![nemo-shen](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | | [![chenjiahan](https://avatars.githubusercontent.com/u/7237365?s=80&v=4)](https://github.com/chenjiahan/) | [![cookfront](https://avatars.githubusercontent.com/u/4829465?s=80&v=4)](https://github.com/cookfront/) | [![w91](https://avatars.githubusercontent.com/u/2599455?s=80&v=4)](https://github.com/w91/) | [![pangxie1991](https://avatars.githubusercontent.com/u/5961240?s=80&v=4)](https://github.com/pangxie1991/) | [![rex-zsd](https://avatars.githubusercontent.com/u/8767877?s=80&v=4)](https://github.com/rex-zsd/) |
| :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | | :-: | :-: | :-: | :-: | :-: |
| [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://avatars.githubusercontent.com/u/13480805?s=80&v=4)](https://github.com/nemo-shen/) | [![Lindysen](https://avatars.githubusercontent.com/u/33708359?s=80&v=4)](https://github.com/Lindysen/) | [![JakeLaoyu](https://avatars.githubusercontent.com/u/16181940?s=80&v=4)](https://github.com/JakeLaoyu/) | [![landluck](https://avatars.githubusercontent.com/u/27060081?s=80&v=4)](https://github.com/landluck/) | [![wjw-gavin](https://avatars.githubusercontent.com/u/19986739?s=80&v=4)](https://github.com/wjw-gavin/) |
| :-: | :-: | :-: | :-: | :-: |
| [nemo-shen](https://github.com/nemo-shen/) | [Lindysen](https://github.com/Lindysen/) | [JakeLaoyu](https://github.com/JakeLaoyu/) | [landluck](https://github.com/landluck/) | [wjw-gavin](https://github.com/wjw-gavin/) |
## 贡献者们 ## 贡献者们
@ -150,6 +155,10 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
使用过程中发现任何问题都可以提 [Issue](https://github.com/vant-ui/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/vant-ui/vant/pulls)。 使用过程中发现任何问题都可以提 [Issue](https://github.com/vant-ui/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/vant-ui/vant/pulls)。
## 在 Cloud IDE 中预览
[https://idegithub.com/youzan/vant](https://idegithub.com/youzan/vant)
## 开源协议 ## 开源协议
本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。 本项目基于 [MIT](https://github.com/youzan/vant/blob/main/LICENSE) 协议,请自由地享受和参与开源。

View File

@ -6,6 +6,7 @@
"lint": "pnpm --dir ./packages/vant lint", "lint": "pnpm --dir ./packages/vant lint",
"test": "pnpm --dir ./packages/vant test", "test": "pnpm --dir ./packages/vant test",
"test:watch": "pnpm --dir ./packages/vant test:watch", "test:watch": "pnpm --dir ./packages/vant test:watch",
"test:update": "pnpm --dir ./packages/vant test:update",
"build": "pnpm --dir ./packages/vant build", "build": "pnpm --dir ./packages/vant build",
"build:site": "pnpm --dir ./packages/vant build:site" "build:site": "pnpm --dir ./packages/vant build:site"
}, },
@ -14,24 +15,16 @@
"*.{ts,tsx,js,vue,less}": "prettier --write", "*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix" "*.{ts,tsx,js,vue}": "eslint --fix"
}, },
"packageManager": "pnpm@7.11.0", "engines": {
"pnpm": ">= 8.0.0"
},
"packageManager": "pnpm@8.1.0",
"devDependencies": { "devDependencies": {
"@vant/cli": "workspace:*", "@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*", "@vant/eslint-config": "workspace:*",
"eslint": "^8.23.0", "eslint": "^8.31.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"nano-staged": "^0.8.0", "nano-staged": "^0.8.0",
"prettier": "^2.7.1", "prettier": "^2.7.1"
"rimraf": "^3.0.2"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@algolia/client-search",
"@types/react",
"react",
"react-dom"
]
}
} }
} }

View File

@ -15,5 +15,5 @@ test/coverage
es es
lib lib
dist dist
site **/site-dist
changelog.generated.md changelog.generated.md

View File

@ -31,7 +31,7 @@
"vue": "^3.0.0" "vue": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@vant/cli": "^4.0.0", "@vant/cli": "^6.0.0",
"vue": "^3.0.0", "vue": "^3.0.0",
"sass": "^1.49.7" "sass": "^1.49.7"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "create-vant-cli-app", "name": "create-vant-cli-app",
"version": "2.0.1", "version": "2.2.0",
"description": "Create Vant CLI App", "description": "Create Vant CLI App",
"main": "lib/index.js", "main": "lib/index.js",
"bin": { "bin": {
@ -31,22 +31,22 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^11.0.1",
"@types/inquirer": "^8.2.3",
"release-it": "^15.4.1", "release-it": "^15.4.1",
"typescript": "^4.8.2" "rimraf": "^5.0.0",
"typescript": "^5.0.4"
}, },
"dependencies": { "dependencies": {
"consola": "^2.11.3", "consola": "^3.0.2",
"fast-glob": "^3.2.11", "fast-glob": "^3.2.11",
"fs-extra": "^10.1.0", "fs-extra": "^11.1.0",
"inquirer": "^8.2.4", "enquirer": "2.3.6",
"picocolors": "^1.0.0" "picocolors": "^1.0.0"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: create-vant-cli-app ${version}" "commitMessage": "release: create-vant-cli-app v${version}"
} }
} }
} }

View File

@ -1,4 +1,4 @@
import { join } from 'path'; import { join } from 'node:path';
export const CWD = process.cwd(); export const CWD = process.cwd();
export const GENERATOR_DIR = join(__dirname, '../generators'); export const GENERATOR_DIR = join(__dirname, '../generators');

View File

@ -1,31 +1,31 @@
import fs from 'fs-extra'; import fs from 'fs-extra';
import glob from 'fast-glob'; import glob from 'fast-glob';
import color from 'picocolors'; import color from 'picocolors';
import consola from 'consola'; import { consola } from 'consola';
import { prompt } from 'inquirer'; import { prompt } from 'enquirer';
import { sep, join } from 'path'; import { sep, join } from 'node:path';
import { CWD, GENERATOR_DIR } from './constant'; import { CWD, GENERATOR_DIR } from './constant';
const PROMPTS = [ const PROMPTS = [
{ {
name: 'vueVersion', name: 'vueVersion',
message: 'Select Vue version', message: 'Select Vue version',
type: 'list', type: 'select',
choices: [ choices: [
{ {
name: 'Vue 2', name: 'vue2',
value: 'vue2', message: 'Vue 2',
}, },
{ {
name: 'Vue 3', name: 'vue3',
value: 'vue3', message: 'Vue 3',
}, },
], ],
}, },
{ {
name: 'preprocessor', name: 'preprocessor',
message: 'Select css preprocessor', message: 'Select css preprocessor',
type: 'list', type: 'select',
choices: ['Less', 'Sass'], choices: ['Less', 'Sass'],
}, },
]; ];

View File

@ -1,20 +1,16 @@
#!/usr/bin/env node #!/usr/bin/env node
import consola from 'consola'; import { consola } from 'consola';
import { prompt } from 'inquirer'; import { prompt } from 'enquirer';
import { ensureDir } from 'fs-extra'; import { ensureDir } from 'fs-extra';
import { VanGenerator } from './generator'; import { VanGenerator } from './generator';
const PROMPTS = [ async function run() {
{ const { name } = await prompt<{ name: string }>({
type: 'input', type: 'input',
name: 'name', name: 'name',
message: 'Your package name', message: 'Your package name',
}, });
];
async function run() {
const { name } = await prompt(PROMPTS);
try { try {
await ensureDir(name); await ensureDir(name);

View File

@ -1,6 +1,6 @@
# Vant Area Data # Vant China Area Data
中国省市区数据,适用于 Vant Area 组件。 中国省市区数据,适用于 Vant Area 和 Cascader 等组件。
## 安装 ## 安装
@ -17,10 +17,20 @@ pnpm add @vant/area-data
## 使用 ## 使用
在 Vant 的 Area 组件中使用时,直接引用 `areaList` 对象即可:
```ts ```ts
import { areaList } from '@vant/area-data'; import { areaList } from '@vant/area-data';
``` ```
在 Vant 的 Cascader 组件中使用时,请使用 `useCascaderAreaData` 方法:
```ts
import { useCascaderAreaData } from '@vant/area-data';
const cascaderAreaData = useCascaderAreaData();
```
## 数据更新 ## 数据更新
中国的行政区划每年都会有变动,如果发现省市区数据未及时更新,欢迎提 Pull Request 帮助我们更新。 中国的行政区划每年都会有变动,如果发现省市区数据未及时更新,欢迎提 Pull Request 帮助我们更新。你可以在[「国家统计局 - 全国区划代码」](http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/) 和[「民政部 - 行政区划代码」](https://www.mca.gov.cn/article/sj/xzqh/1980/)上查询到最新数据,请根据官方数据进行核实。

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/area-data", "name": "@vant/area-data",
"version": "1.3.2", "version": "1.4.1",
"description": "Vant 省市区数据", "description": "Vant 省市区数据",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs", "module": "dist/index.esm.mjs",
@ -11,6 +11,7 @@
"require": "./dist/index.cjs.js" "require": "./dist/index.cjs.js"
} }
}, },
"sideEffects": false,
"files": [ "files": [
"dist" "dist"
], ],
@ -36,14 +37,15 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"esbuild": "^0.14.54", "esbuild": "^0.17.12",
"release-it": "^15.4.1", "release-it": "^15.4.1",
"typescript": "^4.8.2" "rimraf": "^5.0.0",
"typescript": "^5.0.4"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/area-data ${version}" "commitMessage": "release: @vant/area-data v${version}"
} }
} }
} }

View File

@ -1,4 +1,8 @@
export const areaList = { export const areaList: {
province_list: Record<string, string>;
city_list: Record<string, string>;
county_list: Record<string, string>;
} = {
province_list: { province_list: {
110000: '北京市', 110000: '北京市',
120000: '天津市', 120000: '天津市',
@ -1621,7 +1625,6 @@ export const areaList = {
360724: '上犹县', 360724: '上犹县',
360725: '崇义县', 360725: '崇义县',
360726: '安远县', 360726: '安远县',
360727: '龙南县',
360728: '定南县', 360728: '定南县',
360729: '全南县', 360729: '全南县',
360730: '宁都县', 360730: '宁都县',
@ -1631,6 +1634,7 @@ export const areaList = {
360734: '寻乌县', 360734: '寻乌县',
360735: '石城县', 360735: '石城县',
360781: '瑞金市', 360781: '瑞金市',
360783: '龙南市',
360802: '吉州区', 360802: '吉州区',
360803: '青原区', 360803: '青原区',
360821: '吉安县', 360821: '吉安县',
@ -3886,3 +3890,53 @@ export const areaList = {
820204: '圣方济各堂区', 820204: '圣方济各堂区',
}, },
}; };
type CascaderOption = {
text: string;
value: string;
children?: CascaderOption[];
};
const makeOption = (
text: string,
value: string,
children?: CascaderOption[]
): CascaderOption => ({
text,
value,
children,
});
export function useCascaderAreaData() {
const {
city_list: city,
county_list: county,
province_list: province,
} = areaList;
const provinceMap = new Map<string, CascaderOption>();
Object.keys(province).forEach((code) => {
provinceMap.set(code.slice(0, 2), makeOption(province[code], code, []));
});
const cityMap = new Map<string, CascaderOption>();
Object.keys(city).forEach((code) => {
const option = makeOption(city[code], code, []);
cityMap.set(code.slice(0, 4), option);
const province = provinceMap.get(code.slice(0, 2));
if (province) {
province.children!.push(option);
}
});
Object.keys(county).forEach((code) => {
const city = cityMap.get(code.slice(0, 4));
if (city) {
city.children!.push(makeOption(county[code], code));
}
});
return Array.from(provinceMap.values());
}

View File

@ -65,7 +65,7 @@ Please add the followed config to `package.json` file.
## More Details ## More Details
- [cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.md) - [cli](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/commands.md)
- [config](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.md) - [config](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/config.md)
- [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md) - [directory structure](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/directory.md)
- [CHANGELOG](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md) - [CHANGELOG](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/changelog.md)

View File

@ -62,7 +62,7 @@ pnpm add @vant/cli -D
## 详细文档 ## 详细文档
- [命令](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md) - [命令](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/commands.zh-CN.md)
- [配置指南](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md) - [配置指南](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/config.zh-CN.md)
- [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md) - [目录结构](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/directory.zh-CN.md)
- [更新日志](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md) - [更新日志](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/changelog.md)

View File

@ -1,14 +1,61 @@
# 更新日志 # 更新日志
## v5.0.0 (未发布) ## v6.1.0
`2023-03-19`
- 升级 typescript v5
- 升级 esbuild 0.17
- 升级 vite 4.2
- 优化 tsc 错误日志的格式
## v6.0.1
`2023-03-11`
- 修复编译 `mjs` 或者 `cjs` 时, 替换 vue 文件导入出现重复后缀的问题
## v6.0.0
`2023-02-26`
- vite: 由 v3 升级至 v4
- @vitejs/plugin-vue: 由 v3 升级至 v4
- @vitejs/plugin-vue-jsx: 由 v2 升级至 v3
- 移除 `site.searchConfig` 配置项
- 修复 build 时解析 markdown 可能报错的问题
## v5.1.0
`2022-11-05`
- 支持读取 `vite.config.ts` 文件来自定义 vite 配置
- 修复设置 vite 的 `server.port` 配置项不生效的问题
## v5.0.2
`2022-10-07`
- 修复首次运行 dev 时 vite 引入了两份 Vue 代码导致渲染失败的问题
## v5.0.1
`2022-10-06`
- 修复 jest 版本未正确升级的问题
## v5.0.0
### 依赖升级 ### 依赖升级
`2022-10-06`
对以下依赖进行了大版本升级: 对以下依赖进行了大版本升级:
- vite v3 - vite: 由 v2 升级至 v3
- @vitejs/plugin-vue v3 - jest: 由 v27 升级至 v29
- @vitejs/plugin-vue-jsx v2 - @vitejs/plugin-vue: 由 v2 升级至 v3
- @vitejs/plugin-vue-jsx: 由 v1 升级至 v2
### 依赖精简 ### 依赖精简

View File

@ -29,6 +29,10 @@ const DEFAULT_CONFIG = {
], ],
coverageReporters: ['html', 'lcov', 'text-summary'], coverageReporters: ['html', 'lcov', 'text-summary'],
coverageDirectory: './test/coverage', coverageDirectory: './test/coverage',
testEnvironmentOptions: {
// https://stackoverflow.com/questions/72428323/jest-referenceerror-vue-is-not-defined
customExportConditions: ['node', 'node-addons'],
},
}; };
function readRootConfig() { function readRootConfig() {

View File

@ -87,6 +87,8 @@ module.exports = {
if (isJsxFile(path)) { if (isJsxFile(path)) {
code = transformJsx(code, path); code = transformJsx(code, path);
} }
return transformScript(code); return {
code: transformScript(code)
};
}, },
}; };

View File

@ -29,7 +29,7 @@ Start local dev server for browsering components and demo.
Build Vue component library. Build Vue component library.
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md) Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/directory.md)
Please add the followed config to `package.json` when publish to npm. Please add the followed config to `package.json` when publish to npm.

View File

@ -31,7 +31,7 @@ npx vant-cli dev
构建组件库。 构建组件库。
运行 build 命令会在 `es``lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)。 运行 build 命令会在 `es``lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/vant-ui/vant/tree/main/packages/vant-cli/docs/directory.zh-CN.md)。
发布 npm 时,请将以下配置加入到 `package.json` 中,使 npm 包能被正确识别: 发布 npm 时,请将以下配置加入到 `package.json` 中,使 npm 包能被正确识别:

View File

@ -16,7 +16,6 @@
- [site.nav](#sitenav) - [site.nav](#sitenav)
- [site.versions](#siteversions) - [site.versions](#siteversions)
- [site.baiduAnalytics](#sitebaiduanalytics) - [site.baiduAnalytics](#sitebaiduanalytics)
- [site.searchConfig](#sitesearchconfig)
- [site.hideSimulator](#sitehidesimulator) - [site.hideSimulator](#sitehidesimulator)
- [site.simulator.url](#sitesimulatorurl) - [site.simulator.url](#sitesimulatorurl)
- [site.htmlMeta](#sitehtmlmeta) - [site.htmlMeta](#sitehtmlmeta)
@ -177,17 +176,16 @@ When set to `true`, `export * from 'xxx'` will be used to export all modules and
### build.configureVite ### build.configureVite
- Type: `(config: InlineConfig): InlineConfig` - Type: `(config: InlineConfig): InlineConfig | undefined`
- Default: `undefined` - Default: `undefined`
Custom vite config(`@vant/cli>= 4.0.0`) Custom [vite config](https://vitejs.dev/config/), requires `@vant/cli>= 4.0.0`.
```js ```js
module.exports = { module.exports = {
build: { build: {
configureVite(config) { configureVite(config) {
// add vite plugin config.server.port = 3000;
config.plugins.push(vitePluginXXX);
return config; return config;
}, },
}, },
@ -214,10 +212,14 @@ module.exports = {
}; };
``` ```
Note that you are not allowed to import vite plugins in `vant.config.mjs`, because the file will be bundled into the website code.
If you need to configure some vite plugins, please create a `vite.config.ts` file in the same directory of `vant.config.mjs`, in which you can add any vite configuration (this feature requires @vant/cli 5.1.0).
### build.packageManager ### build.packageManager
- Type: `'npm' | 'yarn' | 'pnpm'` - Type: `'npm' | 'yarn' | 'pnpm'`
- Default: `undefined` - Default: `yarn`
`npm` package manager. `npm` package manager.
@ -352,13 +354,6 @@ module.exports = {
}; };
``` ```
### site.searchConfig
- Type: `object`
- Default: `undefined`
Documentation site search config. Based on [docsearch](https://docsearch.algolia.com/docs/behavior) of algolia.
### site.hideSimulator ### site.hideSimulator
- Type: `boolean` - Type: `boolean`

View File

@ -16,7 +16,6 @@
- [site.nav](#sitenav) - [site.nav](#sitenav)
- [site.versions](#siteversions) - [site.versions](#siteversions)
- [site.baiduAnalytics](#sitebaiduanalytics) - [site.baiduAnalytics](#sitebaiduanalytics)
- [site.searchConfig](#sitesearchconfig)
- [site.hideSimulator](#sitehidesimulator) - [site.hideSimulator](#sitehidesimulator)
- [site.simulator.url](#sitesimulatorurl) - [site.simulator.url](#sitesimulatorurl)
- [site.htmlMeta](#sitehtmlmeta) - [site.htmlMeta](#sitehtmlmeta)
@ -177,17 +176,16 @@ module.exports = {
### build.configureVite ### build.configureVite
- Type: `(config: InlineConfig): InlineConfig` - Type: `(config: InlineConfig): InlineConfig | undefined`
- Default: `undefined` - Default: `undefined`
vant-cli 使用 vite 来构建组件库和文档站点,通过 `configureVite` 选项可以自定义 vite 配置(从 4.0.0 版本开始支持)。 vant-cli 使用 vite 来构建组件库和文档站点,通过 `configureVite` 选项可以自定义 [vite 配置](https://vitejs.dev/config/)(从 4.0.0 版本开始支持)。
```js ```js
module.exports = { module.exports = {
build: { build: {
configureVite(config) { configureVite(config) {
// 添加一个自定义插件 config.server.port = 3000;
config.plugins.push(vitePluginXXX);
return config; return config;
}, },
}, },
@ -216,10 +214,14 @@ module.exports = {
}; };
``` ```
注意,由于 `vant.config.mjs` 文件会被打包到文档网站的代码中,因此 `configureVite` 中不允许引用 vite 插件。
如果需要配置 vite 插件,可以在 `vant.config.mjs` 的同级目录下创建 `vite.config.ts` 文件,在该文件中你可以添加任意的 vite 配置(该特性从 @vant/cli 5.1.0 版本开始支持)。
### build.packageManager ### build.packageManager
- Type: `'npm' | 'yarn' | 'pnpm'` - Type: `'npm' | 'yarn' | 'pnpm'`
- Default: `undefined` - Default: `yarn`
指定使用的包管理器。 指定使用的包管理器。
@ -354,15 +356,6 @@ module.exports = {
}; };
``` ```
### site.searchConfig
- Type: `object`
- Default: `undefined`
文档网站的搜索配置,基于 algolia 提供的 docsearch 服务实现。
配置内容参见 [docsearch](https://docsearch.algolia.com/docs/behavior)。
### site.hideSimulator ### site.hideSimulator
- Type: `boolean` - Type: `boolean`

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/cli", "name": "@vant/cli",
"version": "4.0.4", "version": "6.1.0",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"typings": "lib/index.d.ts", "typings": "lib/index.d.ts",
@ -39,61 +39,61 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@jest/types": "^27.5.1", "@jest/types": "^29.1.2",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^11.0.1",
"@types/less": "^3.0.3", "@types/less": "^3.0.3",
"@types/lodash": "^4.14.191",
"@types/markdown-it": "^12.2.3", "@types/markdown-it": "^12.2.3",
"react": "^18.2.0", "rimraf": "^5.0.0",
"react-dom": "^18.2.0", "vue": "^3.3.4"
"vue": "^3.2.38"
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.18.13", "@babel/core": "^7.18.13",
"@babel/preset-typescript": "^7.18.6", "@babel/preset-typescript": "^7.18.6",
"@docsearch/css": "^3.2.1", "@types/jest": "^29.5.1",
"@docsearch/js": "^3.2.1",
"@types/jest": "^27.5.2",
"@vant/eslint-config": "^3.5.0", "@vant/eslint-config": "^3.5.0",
"@vant/touch-emulator": "^1.4.0", "@vant/touch-emulator": "^1.4.0",
"@vitejs/plugin-vue": "^3.0.3", "@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^2.0.1", "@vitejs/plugin-vue-jsx": "^3.0.0",
"@vue/babel-plugin-jsx": "^1.1.1", "@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.8", "autoprefixer": "^10.4.8",
"commander": "^9.4.0", "commander": "^10.0.0",
"consola": "^2.15.3", "consola": "^3.0.2",
"conventional-changelog": "^3.1.25", "conventional-changelog": "^3.1.25",
"esbuild": "^0.14.54", "esbuild": "^0.17.12",
"eslint": "^8.23.0", "eslint": "^8.31.0",
"execa": "^5.1.1", "execa": "^6.1.0",
"fast-glob": "^3.2.11", "fast-glob": "^3.2.11",
"fs-extra": "^10.1.0", "fs-extra": "^11.1.0",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"highlight.js": "^11.6.0", "highlight.js": "^11.6.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"jest": "^27.5.1", "jest": "^29.3.1",
"jest-canvas-mock": "^2.4.0", "jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.1.2",
"jest-serializer-html": "^7.1.0", "jest-serializer-html": "^7.1.0",
"less": "^4.1.3", "less": "^4.1.3",
"lodash": "^4.17.21",
"markdown-it": "^12.3.2", "markdown-it": "^12.3.2",
"markdown-it-anchor": "^8.6.4", "markdown-it-anchor": "^8.6.4",
"nano-staged": "^0.8.0", "nano-staged": "^0.8.0",
"nanospinner": "^1.1.0", "nanospinner": "^1.1.0",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"postcss": "^8.4.16", "postcss": "^8.4.23",
"postcss-load-config": "^3.1.4", "postcss-load-config": "^4.0.1",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"release-it": "^15.4.1", "release-it": "^15.4.1",
"terser": "^5.16.1",
"transliteration": "^2.3.5", "transliteration": "^2.3.5",
"typescript": "^4.8.2", "typescript": "^5.0.4",
"vite": "^3.0.9", "vite": "^4.3.9",
"vite-plugin-html": "^2.1.2",
"vite-plugin-md": "^0.11.9", "vite-plugin-md": "^0.11.9",
"vue-router": "^4.1.5" "vue-router": "^4.1.6"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/cli ${version}" "commitMessage": "release: @vant/cli v${version}"
} }
} }
} }

View File

@ -6,7 +6,7 @@ code {
color: var(--van-doc-code-color); color: var(--van-doc-code-color);
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace; font-family: var(--van-doc-code-font-family);
line-height: 26px; line-height: 26px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
@ -15,6 +15,13 @@ code {
border-radius: var(--van-doc-border-radius); border-radius: var(--van-doc-border-radius);
} }
p {
code {
display: inline-flex;
padding: 4px 10px;
}
}
pre { pre {
margin: 20px 0 0; margin: 20px 0 0;

View File

@ -1,4 +1,4 @@
body { :root {
// colors // colors
--van-doc-black: #000; --van-doc-black: #000;
--van-doc-white: #fff; --van-doc-white: #fff;
@ -12,15 +12,20 @@ body {
--van-doc-gray-8: #323233; --van-doc-gray-8: #323233;
--van-doc-blue: #1989fa; --van-doc-blue: #1989fa;
--van-doc-green: #07c160; --van-doc-green: #07c160;
--van-doc-purple: #8e69d3;
// sizes // sizes
--van-doc-padding: 24px; --van-doc-padding: 32px;
--van-doc-row-max-width: 1680px; --van-doc-row-max-width: 1680px;
--van-doc-nav-width: 220px; --van-doc-nav-width: 220px;
--van-doc-border-radius: 20px; --van-doc-border-radius: 20px;
--van-doc-simulator-width: 360px; --van-doc-simulator-width: 360px;
--van-doc-simulator-height: 620px; --van-doc-simulator-height: 620px;
--van-doc-header-top-height: 64px; --van-doc-header-top-height: 64px;
// fonts
--van-doc-code-font-family: 'Menlo', 'Source Code Pro', 'Monaco',
'Inconsolata', monospace;
} }
.van-doc-theme-light { .van-doc-theme-light {
@ -44,7 +49,7 @@ body {
--van-doc-code-background: var(--van-doc-gray-1); --van-doc-code-background: var(--van-doc-gray-1);
// blockquote // blockquote
--van-doc-blockquote-color: #4994df; --van-doc-blockquote-color: #2f85da;
--van-doc-blockquote-background: #ecf9ff; --van-doc-blockquote-background: #ecf9ff;
} }

View File

@ -12,6 +12,11 @@ import { copyToClipboard } from '../../common';
export default { export default {
name: 'VanDocContent', name: 'VanDocContent',
data() {
return {
iframeDocument: null,
};
},
computed: { computed: {
currentPage() { currentPage() {
@ -50,6 +55,22 @@ export default {
name: this.$route.name, name: this.$route.name,
hash: '#' + target.id, hash: '#' + target.id,
}); });
this.syncMobilePos(target.id);
}
},
syncMobilePos(id) {
// Getting the document at this point is to ensure that the target has been fully rendered.
if (!this.iframeDocument) {
const iframe = document.querySelector('iframe');
this.iframeDocument = iframe.contentWindow.document;
}
if (this.iframeDocument) {
const target = this.iframeDocument.getElementById(id);
if (target) {
target.scrollIntoView(true);
}
} }
}, },
@ -83,8 +104,8 @@ export default {
<style lang="less"> <style lang="less">
.van-doc-card { .van-doc-card {
margin-bottom: 24px; margin-bottom: var(--van-doc-padding);
padding: 24px; padding: 28px 28px 32px;
background-color: var(--van-doc-background-2); background-color: var(--van-doc-background-2);
border-radius: var(--van-doc-border-radius); border-radius: var(--van-doc-border-radius);
overflow: auto; overflow: auto;
@ -185,7 +206,7 @@ export default {
} }
> p { > p {
margin-top: 8px; margin-top: 16px;
color: var(--van-doc-text-color-3); color: var(--van-doc-text-color-3);
font-size: 15px; font-size: 15px;
line-height: 26px; line-height: 26px;
@ -245,7 +266,7 @@ export default {
display: inline-block; display: inline-block;
color: var(--van-doc-green); color: var(--van-doc-green);
font-size: 14px; font-size: 14px;
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace; font-family: var(--van-doc-code-font-family);
font-style: normal; font-style: normal;
max-width: 300px; max-width: 300px;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
@ -253,7 +274,7 @@ export default {
} }
> ul { > ul {
margin: 12px 0; margin: 16px 0 0;
} }
> ul li, > ul li,
@ -291,19 +312,19 @@ export default {
> table code { > table code {
display: inline; display: inline;
margin: 0 2px; margin: 0 2px;
padding: 2px 5px; padding: 3px 7px;
font-size: 14px; font-size: 14px;
font-family: inherit;
font-weight: 600;
word-break: keep-all; word-break: keep-all;
border-radius: 4px; border-radius: 6px;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: auto;
font-family: var(--van-doc-code-font-family);
} }
> blockquote { > blockquote {
margin: 16px 0 0; margin: 16px 0 0;
padding: 16px; padding: 16px;
font-size: 14px; font-size: 15px;
line-height: 26px;
color: var(--van-doc-blockquote-color); color: var(--van-doc-blockquote-color);
background-color: var(--van-doc-blockquote-background); background-color: var(--van-doc-blockquote-background);
border-radius: var(--van-doc-border-radius); border-radius: var(--van-doc-border-radius);
@ -312,7 +333,7 @@ export default {
> img, > img,
> p img { > p img {
width: 100%; width: 100%;
margin: 16px 0; margin: 16px 0 0;
border-radius: var(--van-doc-border-radius); border-radius: var(--van-doc-border-radius);
} }
} }
@ -323,7 +344,7 @@ export default {
padding: 0 0 75px; padding: 0 0 75px;
.van-doc-markdown-body { .van-doc-markdown-body {
padding: 24px; padding: var(--van-doc-padding);
overflow: hidden; overflow: hidden;
h1, h1,
@ -343,7 +364,7 @@ export default {
} }
h2 { h2 {
margin: 45px 0 20px; margin: 52px 0 20px;
font-size: 26px; font-size: 26px;
} }
} }

View File

@ -64,12 +64,6 @@
{{ langLabel }} {{ langLabel }}
</a> </a>
</li> </li>
<search-input
v-if="searchConfig"
:lang="lang"
:search-config="searchConfig"
/>
</ul> </ul>
</div> </div>
</div> </div>
@ -77,17 +71,12 @@
</template> </template>
<script> <script>
import SearchInput from './SearchInput.vue';
import { packageVersion } from 'site-desktop-shared'; import { packageVersion } from 'site-desktop-shared';
import { getDefaultTheme, syncThemeToChild } from '../../common/iframe-sync'; import { getDefaultTheme, syncThemeToChild } from '../../common/iframe-sync';
export default { export default {
name: 'VanDocHeader', name: 'VanDocHeader',
components: {
SearchInput,
},
props: { props: {
lang: String, lang: String,
config: Object, config: Object,
@ -122,10 +111,6 @@ export default {
return {}; return {};
}, },
searchConfig() {
return this.config.searchConfig;
},
themeImg() { themeImg() {
if (this.currentTheme === 'light') { if (this.currentTheme === 'light') {
return 'https://b.yzcdn.cn/vant/dark-theme.svg'; return 'https://b.yzcdn.cn/vant/dark-theme.svg';
@ -138,8 +123,8 @@ export default {
currentTheme: { currentTheme: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
window.localStorage.setItem('vantTheme', newVal); window.localStorage.setItem('vantTheme', newVal);
document.body.classList.remove(`van-doc-theme-${oldVal}`); document.documentElement.classList.remove(`van-doc-theme-${oldVal}`);
document.body.classList.add(`van-doc-theme-${newVal}`); document.documentElement.classList.add(`van-doc-theme-${newVal}`);
syncThemeToChild(newVal); syncThemeToChild(newVal);
}, },
immediate: true, immediate: true,
@ -187,6 +172,8 @@ export default {
width: 100%; width: 100%;
background-color: var(--van-doc-header-background); background-color: var(--van-doc-header-background);
user-select: none; user-select: none;
position: relative;
z-index: 2;
&__top { &__top {
display: flex; display: flex;

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="van-doc-nav" :style="style"> <div :class="['van-doc-nav', { 'van-doc-nav-fixed': isFixed }]">
<div <div
v-for="(group, index) in navConfig" v-for="(group, index) in navConfig"
class="van-doc-nav__group" class="van-doc-nav__group"
@ -38,19 +38,11 @@ export default {
data() { data() {
return { return {
top: 64, isFixed: false,
bottom: 0,
}; };
}, },
computed: { computed: {
style() {
return {
top: this.top + 'px',
bottom: this.bottom + 'px',
};
},
base() { base() {
return this.lang ? `/${this.lang}/` : '/'; return this.lang ? `/${this.lang}/` : '/';
}, },
@ -64,7 +56,7 @@ export default {
methods: { methods: {
onScroll() { onScroll() {
const { pageYOffset: offset } = window; const { pageYOffset: offset } = window;
this.top = Math.max(0, 64 - offset); this.isFixed = offset > 64;
}, },
}, },
}; };
@ -72,8 +64,10 @@ export default {
<style lang="less"> <style lang="less">
.van-doc-nav { .van-doc-nav {
position: fixed; position: absolute;
left: 0; left: 0;
top: var(--van-doc-header-top-height);
bottom: 0;
z-index: 1; z-index: 1;
min-width: var(--van-doc-nav-width); min-width: var(--van-doc-nav-width);
max-width: var(--van-doc-nav-width); max-width: var(--van-doc-nav-width);
@ -86,6 +80,10 @@ export default {
margin-left: calc((var(--van-doc-row-max-width) / 2 * -1)); margin-left: calc((var(--van-doc-row-max-width) / 2 * -1));
} }
&.van-doc-nav-fixed {
position: fixed;
top: 0;
}
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 6px; width: 6px;
height: 6px; height: 6px;
@ -110,14 +108,14 @@ export default {
padding: 24px 0 0 var(--van-doc-padding); padding: 24px 0 0 var(--van-doc-padding);
color: var(--van-doc-text-color-2); color: var(--van-doc-text-color-2);
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 16px;
line-height: 28px; line-height: 28px;
} }
&__item { &__item {
a { a {
display: block; display: block;
margin: 8px 0; margin: 4px 0;
padding: 6px 0 6px var(--van-doc-padding); padding: 6px 0 6px var(--van-doc-padding);
color: var(--van-doc-text-color-3); color: var(--van-doc-text-color-3);
font-size: 14px; font-size: 14px;

View File

@ -1,63 +0,0 @@
<template>
<div id="docsearch" />
</template>
<script>
export default {
name: 'VanDocSearch',
props: {
lang: String,
searchConfig: Object,
},
watch: {
lang() {
this.initDocsearch();
},
},
mounted() {
this.initDocsearch();
},
methods: {
initDocsearch() {
if (this.searchConfig) {
import('@docsearch/css');
import('@docsearch/js').then((docsearch) => {
docsearch.default({
...this.searchConfig,
container: '#docsearch',
});
});
}
},
},
};
</script>
<style lang="less">
#docsearch {
display: inline-block;
vertical-align: middle;
}
.DocSearch-Button {
height: 32px;
background: #f7f8fa;
&:hover {
box-shadow: none;
}
}
.DocSearch-Search-Icon {
width: 18px;
height: 18px;
}
.DocSearch-Button-Key {
font-size: 12px;
}
</style>

View File

@ -11,12 +11,12 @@
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/> />
<%- meta %> <%= meta %>
<meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<% if (headHtml) { %> <% if (headHtml) { %>
<%- headHtml %> <%= headHtml %>
<% } %> <% } %>
<% if (baiduAnalytics) { %> <% if (baiduAnalytics) { %>
<script> <script>

View File

@ -11,12 +11,12 @@
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
/> />
<%- meta %> <%= meta %>
<meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<% if (headHtml) { %> <% if (headHtml) { %>
<%- headHtml %> <%= headHtml %>
<% } %> <% } %>
<% if (enableVConsole) { %> <% if (enableVConsole) { %>
<script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script> <script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>

View File

@ -1,11 +1,11 @@
<template> <template>
<demo-nav /> <demo-nav />
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<keep-alive> <demo-section>
<demo-section> <keep-alive>
<component :is="Component" /> <component :is="Component" />
</demo-section> </keep-alive>
</keep-alive> </demo-section>
</router-view> </router-view>
</template> </template>
@ -24,12 +24,21 @@ export default {
watch( watch(
theme, theme,
(newVal, oldVal) => { (newVal, oldVal) => {
document.body.classList.remove(`van-doc-theme-${oldVal}`); document.documentElement.classList.remove(`van-doc-theme-${oldVal}`);
document.body.classList.add(`van-doc-theme-${newVal}`); document.documentElement.classList.add(`van-doc-theme-${newVal}`);
const { darkModeClass } = config.site; const { darkModeClass, lightModeClass } = config.site;
if (darkModeClass) { if (darkModeClass) {
document.body.classList.toggle(darkModeClass, newVal === 'dark'); document.documentElement.classList.toggle(
darkModeClass,
newVal === 'dark'
);
}
if (lightModeClass) {
document.documentElement.classList.toggle(
lightModeClass,
newVal === 'light'
);
} }
}, },
{ immediate: true } { immediate: true }
@ -43,6 +52,7 @@ export default {
body { body {
min-width: 100vw; min-width: 100vw;
background-color: inherit;
} }
.van-doc-theme-light { .van-doc-theme-light {

View File

@ -1,6 +1,8 @@
<template> <template>
<div class="van-doc-demo-block"> <div class="van-doc-demo-block">
<h2 v-if="title" class="van-doc-demo-block__title">{{ title }}</h2> <h2 v-if="title" class="van-doc-demo-block__title" :id="slugifyTitle">
{{ title }}
</h2>
<div v-if="card" class="van-doc-demo-block__card"> <div v-if="card" class="van-doc-demo-block__card">
<slot /> <slot />
</div> </div>
@ -16,6 +18,39 @@ export default {
card: Boolean, card: Boolean,
title: String, title: String,
}, },
data() {
return {
slugify: null,
};
},
computed: {
slugifyTitle() {
return this.slugify ? this.slugify(this.title) : '';
},
},
watch: {
slugifyTitle(newVal) {
if (newVal) {
this.$nextTick(() => {
let hash = '';
if (top) hash = top.location.hash.split('#').pop();
else hash = location.hash.split('#').pop();
const target = document.getElementById(newVal);
if (target && newVal === hash) {
target.scrollIntoView(true);
}
});
}
},
},
async mounted() {
const { slugify } = await import('transliteration');
this.slugify = slugify;
},
}; };
</script> </script>

View File

@ -93,6 +93,7 @@ export default {
margin: 0 0 40px; margin: 0 0 40px;
color: var(--van-doc-text-color-4); color: var(--van-doc-text-color-4);
font-size: 14px; font-size: 14px;
line-height: 1.6;
} }
} }
</style> </style>

View File

@ -45,6 +45,10 @@ program
'--runInBand', '--runInBand',
'Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests' 'Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests'
) )
.option(
'--updateSnapshot',
'Re-record every snapshot that fails during this test run'
)
.option('--debug', 'Print debugging info about your Jest config') .option('--debug', 'Print debugging info about your Jest config')
.action(async (options) => { .action(async (options) => {
const { test } = await import('./commands/jest.js'); const { test } = await import('./commands/jest.js');

View File

@ -1,6 +1,6 @@
import fse from 'fs-extra'; import fse from 'fs-extra';
import execa from 'execa'; import { execa } from 'execa';
import { join, relative } from 'path'; import { join, relative } from 'node:path';
import { clean } from './clean.js'; import { clean } from './clean.js';
import { CSS_LANG } from '../common/css.js'; import { CSS_LANG } from '../common/css.js';
import { createSpinner, consola } from '../common/logger.js'; import { createSpinner, consola } from '../common/logger.js';
@ -104,7 +104,10 @@ async function buildTypeDeclarations() {
const tsConfig = join(process.cwd(), 'tsconfig.declaration.json'); const tsConfig = join(process.cwd(), 'tsconfig.declaration.json');
if (existsSync(tsConfig)) { if (existsSync(tsConfig)) {
await execa('tsc', ['-p', tsConfig]); await execa('tsc', ['-p', tsConfig], {
stdout: 'inherit',
stderr: 'inherit',
});
} }
} }

View File

@ -1,8 +1,8 @@
import { join, dirname } from 'path'; import { join, dirname } from 'node:path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'node:url';
import { ROOT } from '../common/constant.js'; import { ROOT } from '../common/constant.js';
import { createSpinner, slimPath } from '../common/logger.js'; import { createSpinner, slimPath } from '../common/logger.js';
import { createWriteStream, readFileSync } from 'fs'; import { createWriteStream, readFileSync } from 'node:fs';
import conventionalChangelog from 'conventional-changelog'; import conventionalChangelog from 'conventional-changelog';
const DIST_FILE = join(ROOT, './changelog.generated.md'); const DIST_FILE = join(ROOT, './changelog.generated.md');

View File

@ -1,4 +1,4 @@
import { readFileSync } from 'fs'; import { readFileSync } from 'node:fs';
import { consola } from '../common/logger.js'; import { consola } from '../common/logger.js';
const commitRE = const commitRE =

View File

@ -24,6 +24,7 @@ export function test(command: Config.Argv) {
clearCache: command.clearCache, clearCache: command.clearCache,
changedSince: command.changedSince, changedSince: command.changedSince,
logHeapUsage: command.logHeapUsage, logHeapUsage: command.logHeapUsage,
updateSnapshot: command.updateSnapshot,
// make jest tests faster // make jest tests faster
// see: https://ivantanev.com/make-jest-faster/ // see: https://ivantanev.com/make-jest-faster/
maxWorkers: '50%', maxWorkers: '50%',

View File

@ -1,4 +1,4 @@
import execa from 'execa'; import { execa } from 'execa';
import { consola, createSpinner } from '../common/logger.js'; import { consola, createSpinner } from '../common/logger.js';
import { SCRIPT_EXTS } from '../common/constant.js'; import { SCRIPT_EXTS } from '../common/constant.js';
@ -18,7 +18,7 @@ function runCommand(
return new Promise((resolve) => { return new Promise((resolve) => {
execa(cmd, options, { execa(cmd, options, {
preferLocal: true, preferLocal: true,
env: { FORCE_COLOR: true }, env: { FORCE_COLOR: 'true' },
}) })
.then(() => { .then(() => {
spinner.success({ text: messages.succeed }); spinner.success({ text: messages.succeed });

View File

@ -1,7 +1,7 @@
/* eslint-disable no-template-curly-in-string */ /* eslint-disable no-template-curly-in-string */
import releaseIt from 'release-it'; import releaseIt from 'release-it';
import { join, dirname } from 'path'; import { join, dirname } from 'node:path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js'); const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js');

View File

@ -1,6 +1,6 @@
import { existsSync, readFileSync } from 'fs'; import { existsSync, readFileSync } from 'node:fs';
import { fileURLToPath, pathToFileURL } from 'url'; import { fileURLToPath, pathToFileURL } from 'node:url';
import { join, dirname, isAbsolute } from 'path'; import { join, dirname, isAbsolute } from 'node:path';
function findRootDir(dir: string): string { function findRootDir(dir: string): string {
if (existsSync(join(dir, 'vant.config.mjs'))) { if (existsSync(join(dir, 'vant.config.mjs'))) {

View File

@ -1,5 +1,5 @@
import { existsSync } from 'fs'; import { existsSync } from 'node:fs';
import { join, isAbsolute } from 'path'; import { join, isAbsolute } from 'node:path';
import { getVantConfig } from '../common/index.js'; import { getVantConfig } from '../common/index.js';
import { STYLE_DIR, SRC_DIR } from './constant.js'; import { STYLE_DIR, SRC_DIR } from './constant.js';

View File

@ -1,7 +1,7 @@
import fse from 'fs-extra'; import fse from 'fs-extra';
import { sep, join } from 'path'; import { sep, join } from 'node:path';
import { SRC_DIR, getVantConfig } from './constant.js'; import { SRC_DIR, getVantConfig } from './constant.js';
import type { InlineConfig } from 'vite'; import { InlineConfig, loadConfigFromFile, mergeConfig } from 'vite';
const { lstatSync, existsSync, readdirSync, readFileSync, outputFileSync } = const { lstatSync, existsSync, readdirSync, readFileSync, outputFileSync } =
fse; fse;
@ -114,13 +114,33 @@ export function smartOutputFile(filePath: string, content: string) {
outputFileSync(filePath, content); outputFileSync(filePath, content);
} }
export function mergeCustomViteConfig(config: InlineConfig) { export async function mergeCustomViteConfig(
config: InlineConfig,
mode: 'production' | 'development'
): Promise<InlineConfig> {
const vantConfig = getVantConfig(); const vantConfig = getVantConfig();
const configureVite = vantConfig.build?.configureVite; const configureVite = vantConfig.build?.configureVite;
const userConfig = await loadConfigFromFile(
{
mode,
command: mode === 'development' ? 'serve' : 'build',
},
undefined,
process.cwd()
);
if (configureVite) { if (configureVite) {
return configureVite(config); const ret = configureVite(config);
if (ret) {
config = ret;
}
} }
if (userConfig) {
return mergeConfig(config, userConfig.config);
}
return config; return config;
} }

View File

@ -1,6 +1,6 @@
import { createSpinner } from 'nanospinner'; import { createSpinner } from 'nanospinner';
import color from 'picocolors'; import color from 'picocolors';
import consola from 'consola'; import { consola } from 'consola';
import { ROOT } from '../common/constant.js'; import { ROOT } from '../common/constant.js';
export function slimPath(path: string) { export function slimPath(path: string) {

View File

@ -1,4 +1,4 @@
import execa from 'execa'; import { execa } from 'execa';
import { consola } from './logger.js'; import { consola } from './logger.js';
import { execSync } from 'child_process'; import { execSync } from 'child_process';
import { getVantConfig } from './constant.js'; import { getVantConfig } from './constant.js';

View File

@ -34,8 +34,13 @@ export async function compileBundles() {
getVantConfig().build?.bundleOptions || DEFAULT_OPTIONS; getVantConfig().build?.bundleOptions || DEFAULT_OPTIONS;
await Promise.all( await Promise.all(
bundleOptions.map((config) => bundleOptions.map(async (config) =>
build(mergeCustomViteConfig(getViteConfigForPackage(config))) build(
await mergeCustomViteConfig(
getViteConfigForPackage(config),
'production'
)
)
) )
); );
} }

View File

@ -1,6 +1,6 @@
import less from 'less'; import less from 'less';
import { join } from 'path'; import { join } from 'node:path';
import { readFileSync } from 'fs'; import { readFileSync } from 'node:fs';
import { CWD } from '../common/constant.js'; import { CWD } from '../common/constant.js';
export async function compileLess(filePath: string) { export async function compileLess(filePath: string) {

View File

@ -1,4 +1,4 @@
import { createRequire } from 'module'; import { createRequire } from 'node:module';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);

View File

@ -1,7 +1,7 @@
import fse from 'fs-extra'; import fse from 'fs-extra';
import babel from '@babel/core'; import babel from '@babel/core';
import esbuild, { type Format } from 'esbuild'; import esbuild, { type Format } from 'esbuild';
import { sep } from 'path'; import { sep } from 'node:path';
import { isJsx, replaceExt, getVantConfig } from '../common/index.js'; import { isJsx, replaceExt, getVantConfig } from '../common/index.js';
import { replaceCSSImportExt } from '../common/css.js'; import { replaceCSSImportExt } from '../common/css.js';
import { replaceScriptImportExt } from './get-deps.js'; import { replaceScriptImportExt } from './get-deps.js';

View File

@ -1,5 +1,5 @@
import fse from 'fs-extra'; import fse from 'fs-extra';
import path from 'path'; import path from 'node:path';
import hash from 'hash-sum'; import hash from 'hash-sum';
import { import {
parse, parse,

View File

@ -1,5 +1,5 @@
import color from 'picocolors'; import color from 'picocolors';
import { createRequire } from 'module'; import { createRequire } from 'node:module';
import { createServer, build } from 'vite'; import { createServer, build } from 'vite';
import { import {
getViteConfigForSiteDev, getViteConfigForSiteDev,
@ -29,12 +29,18 @@ export function genSiteEntry(): Promise<void> {
export async function compileSite(production = false) { export async function compileSite(production = false) {
await genSiteEntry(); await genSiteEntry();
if (production) { if (production) {
const config = mergeCustomViteConfig(getViteConfigForSiteProd()); const config = await mergeCustomViteConfig(
getViteConfigForSiteProd(),
'production'
);
await build(config); await build(config);
} else { } else {
const config = mergeCustomViteConfig(getViteConfigForSiteDev()); const config = await mergeCustomViteConfig(
getViteConfigForSiteDev(),
'development'
);
const server = await createServer(config); const server = await createServer(config);
await server.listen(); await server.listen(config.server?.port);
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
const { version } = require('vite/package.json'); const { version } = require('vite/package.json');

View File

@ -1,4 +1,4 @@
import { parse } from 'path'; import { parse } from 'node:path';
import fse from 'fs-extra'; import fse from 'fs-extra';
import { getVantConfig, replaceExt } from '../common/index.js'; import { getVantConfig, replaceExt } from '../common/index.js';
import { compileCss } from './compile-css.js'; import { compileCss } from './compile-css.js';

View File

@ -3,8 +3,8 @@
*/ */
import fse from 'fs-extra'; import fse from 'fs-extra';
import { createRequire } from 'module'; import { createRequire } from 'node:module';
import { sep, join, relative } from 'path'; import { sep, join, relative } from 'node:path';
import { getComponents, replaceExt } from '../common/index.js'; import { getComponents, replaceExt } from '../common/index.js';
import { CSS_LANG, getCssBaseFile } from '../common/css.js'; import { CSS_LANG, getCssBaseFile } from '../common/css.js';
import { checkStyleExists } from './gen-style-deps-map.js'; import { checkStyleExists } from './gen-style-deps-map.js';

View File

@ -1,4 +1,4 @@
import { join } from 'path'; import { join } from 'node:path';
import { import {
pascalize, pascalize,
getComponents, getComponents,

View File

@ -1,6 +1,6 @@
import { join } from 'path'; import { join } from 'node:path';
import { existsSync } from 'fs'; import { existsSync } from 'node:fs';
import { createRequire } from 'module'; import { createRequire } from 'node:module';
import { smartOutputFile, normalizePath } from '../common/index.js'; import { smartOutputFile, normalizePath } from '../common/index.js';
import { CSS_LANG, getCssBaseFile } from '../common/css.js'; import { CSS_LANG, getCssBaseFile } from '../common/css.js';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js'; import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js';

View File

@ -1,12 +1,7 @@
import glob from 'fast-glob'; import glob from 'fast-glob';
import { join, parse } from 'path'; import { join, parse } from 'node:path';
import { existsSync, readFileSync, readdirSync } from 'fs'; import { existsSync, readFileSync, readdirSync } from 'node:fs';
import { import { pascalize, getVantConfig, normalizePath } from '../common/index.js';
isDev,
pascalize,
getVantConfig,
normalizePath,
} from '../common/index.js';
import { import {
SRC_DIR, SRC_DIR,
DOCS_DIR, DOCS_DIR,
@ -80,10 +75,7 @@ function genImportDocuments(items: DocumentItem[]) {
return items return items
.map((item) => { .map((item) => {
const path = normalizePath(item.path); const path = normalizePath(item.path);
if (isDev()) { return `const ${item.name} = () => import('${path}');`;
return `const ${item.name} = () => import('${path}');`;
}
return `import ${item.name} from '${path}';`;
}) })
.join('\n'); .join('\n');
} }

View File

@ -1,5 +1,5 @@
import { join } from 'path'; import { join } from 'node:path';
import { existsSync, readdirSync } from 'fs'; import { existsSync, readdirSync } from 'node:fs';
import { SRC_DIR } from '../common/constant.js'; import { SRC_DIR } from '../common/constant.js';
import { import {
pascalize, pascalize,

View File

@ -1,6 +1,6 @@
import { relative, sep, join } from 'path'; import { relative, sep, join } from 'node:path';
import { CSS_LANG } from '../common/css.js'; import { CSS_LANG } from '../common/css.js';
import { existsSync } from 'fs'; import { existsSync } from 'node:fs';
import { getDeps, clearDepsCache, fillExt } from './get-deps.js'; import { getDeps, clearDepsCache, fillExt } from './get-deps.js';
import { getComponents, smartOutputFile } from '../common/index.js'; import { getComponents, smartOutputFile } from '../common/index.js';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js'; import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js';

View File

@ -1,6 +1,6 @@
import { join } from 'path'; import { join } from 'node:path';
import { SCRIPT_EXTS, STYLE_EXTS } from '../common/constant.js'; import { SCRIPT_EXTS, STYLE_EXTS } from '../common/constant.js';
import { readFileSync, existsSync } from 'fs'; import { readFileSync, existsSync } from 'node:fs';
let depsMap: Record<string, string[]> = {}; let depsMap: Record<string, string[]> = {};
let existsCache: Record<string, boolean> = {}; let existsCache: Record<string, boolean> = {};
@ -127,6 +127,12 @@ export function replaceScriptImportExt(
return; return;
} }
const isExistExt = line.includes(ext);
if (isExistExt) {
return;
}
const pathInfo = getPathByImport(line, filePath); const pathInfo = getPathByImport(line, filePath);
if (pathInfo) { if (pathInfo) {

View File

@ -1,11 +1,6 @@
/* eslint-disable no-continue */ /* eslint-disable no-continue */
import { Articles } from './parser.js'; import { Articles } from './parser.js';
import { import { formatType, removeVersion, toKebabCase } from './utils.js';
formatOptions,
formatType,
removeVersion,
toKebabCase,
} from './utils.js';
import { VueEventArgument, VueTag } from './type.js'; import { VueEventArgument, VueTag } from './type.js';
function formatComponentName(name: string, tagPrefix: string) { function formatComponentName(name: string, tagPrefix: string) {
@ -34,9 +29,15 @@ function formatArguments(input: string): VueEventArgument[] {
} else if ([':', ',', '_', ' '].includes(input[0])) { } else if ([':', ',', '_', ' '].includes(input[0])) {
input = input.substring(1); input = input.substring(1);
} else { } else {
const val = input.match(/( |'|\||\w)+/)![0] || ''; const matched = input.match(/( |'|\||\w)+/);
input = input.substring(val.length);
items.push(val); if (matched?.length && matched[0]) {
const val = matched[0];
input = input.substring(val.length);
items.push(val);
} else {
input = '';
}
} }
} }
@ -66,9 +67,6 @@ function findTag(vueTags: VueTag[], name: string) {
const newTag: VueTag = { const newTag: VueTag = {
name, name,
slots: [],
events: [],
attributes: [],
}; };
vueTags.push(newTag); vueTags.push(newTag);
@ -107,12 +105,16 @@ export function formatter(
const tag = findTag(vueTags, name); const tag = findTag(vueTags, name);
table.body.forEach((line) => { table.body.forEach((line) => {
const [name, desc, type, defaultVal, options] = line; const [name, desc, type, defaultVal] = line;
tag.attributes!.push({
if (!tag.attributes) {
tag.attributes = [];
}
tag.attributes.push({
name: removeVersion(name), name: removeVersion(name),
default: defaultVal, default: defaultVal,
description: desc, description: desc,
options: formatOptions(options),
value: { value: {
type: formatType(type), type: formatType(type),
kind: 'expression', kind: 'expression',
@ -128,7 +130,12 @@ export function formatter(
table.body.forEach((line) => { table.body.forEach((line) => {
const [name, desc, args] = line; const [name, desc, args] = line;
tag.events!.push({
if (!tag.events) {
tag.events = [];
}
tag.events.push({
name: removeVersion(name), name: removeVersion(name),
description: desc, description: desc,
arguments: formatArguments(args), arguments: formatArguments(args),
@ -143,7 +150,12 @@ export function formatter(
table.body.forEach((line) => { table.body.forEach((line) => {
const [name, desc] = line; const [name, desc] = line;
tag.slots!.push({
if (!tag.slots) {
tag.slots = [];
}
tag.slots.push({
name: removeVersion(name), name: removeVersion(name),
description: desc, description: desc,
}); });

View File

@ -1,5 +1,5 @@
import glob from 'fast-glob'; import glob from 'fast-glob';
import { join } from 'path'; import { join } from 'node:path';
import fse from 'fs-extra'; import fse from 'fs-extra';
import { mdParser } from './parser.js'; import { mdParser } from './parser.js';
import { formatter } from './formatter.js'; import { formatter } from './formatter.js';
@ -36,7 +36,7 @@ export async function parseAndWrite(options: Options) {
const webTypes = genWebTypes(vueTags, options); const webTypes = genWebTypes(vueTags, options);
fse.outputFileSync( fse.outputFileSync(
join(options.outputDir, 'web-types.json'), join(options.outputDir, 'web-types.json'),
JSON.stringify(webTypes, null, 2) JSON.stringify(webTypes)
); );
} }

View File

@ -1,4 +1,4 @@
import { PathLike } from 'fs'; import { PathLike } from 'node:fs';
export type VueSlot = { export type VueSlot = {
name: string; name: string;
@ -20,7 +20,6 @@ export type VueAttribute = {
name: string; name: string;
default: string; default: string;
description: string; description: string;
options: string[];
value: { value: {
kind: 'expression'; kind: 'expression';
type: string; type: string;

View File

@ -20,9 +20,3 @@ export function formatType(type: string) {
export function normalizePath(path: string): string { export function normalizePath(path: string): string {
return path.replace(/\\/g, '/'); return path.replace(/\\/g, '/');
} }
// `default` `primary` -> ['default', 'primary']
export function formatOptions(options?: string) {
if (!options) return [];
return options.replace(/`/g, '').split(' ');
}

View File

@ -12,8 +12,8 @@ export function genWebTypes(tags: VueTag[], options: Options) {
html: { html: {
tags, tags,
attributes: [], attributes: [],
'types-syntax': 'typescript',
}, },
}, },
'js-types-syntax': 'typescript',
}; };
} }

View File

@ -1,4 +1,4 @@
import { join } from 'path'; import { join } from 'node:path';
import { setBuildTarget } from '../common/index.js'; import { setBuildTarget } from '../common/index.js';
import { CWD, ES_DIR, getVantConfig, LIB_DIR } from '../common/constant.js'; import { CWD, ES_DIR, getVantConfig, LIB_DIR } from '../common/constant.js';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
@ -28,6 +28,8 @@ export function getViteConfigForPackage({
: undefined, : undefined,
build: { build: {
emptyOutDir: false,
lib: { lib: {
name, name,
entry, entry,

View File

@ -1,12 +1,12 @@
import { join } from 'path'; import { join } from 'node:path';
import { createRequire } from 'module'; import { createRequire } from 'node:module';
import hljs from 'highlight.js'; import hljs from 'highlight.js';
import vitePluginMd from 'vite-plugin-md'; import vitePluginMd from 'vite-plugin-md';
import vitePluginVue from '@vitejs/plugin-vue'; import vitePluginVue from '@vitejs/plugin-vue';
import vitePluginJsx from '@vitejs/plugin-vue-jsx'; import vitePluginJsx from '@vitejs/plugin-vue-jsx';
import { setBuildTarget, getVantConfig, isDev } from '../common/index.js'; import { setBuildTarget, getVantConfig, isDev } from '../common/index.js';
import { SITE_DIST_DIR, SITE_SRC_DIR } from '../common/constant.js'; import { SITE_DIST_DIR, SITE_SRC_DIR } from '../common/constant.js';
import { injectHtml } from 'vite-plugin-html'; import lodash from 'lodash';
import type { InlineConfig, PluginOption } from 'vite'; import type { InlineConfig, PluginOption } from 'vite';
import type MarkdownIt from 'markdown-it'; import type MarkdownIt from 'markdown-it';
import { genSiteMobileShared } from '../compiler/gen-site-mobile-shared.js'; import { genSiteMobileShared } from '../compiler/gen-site-mobile-shared.js';
@ -131,6 +131,18 @@ function vitePluginGenVantBaseCode(): PluginOption {
}; };
} }
function vitePluginHTML(data: object): PluginOption {
return {
name: 'vite-plugin-html',
transformIndexHtml: {
enforce: 'pre',
transform(html) {
return lodash.template(html)(data);
},
},
};
}
export function getViteConfigForSiteDev(): InlineConfig { export function getViteConfigForSiteDev(): InlineConfig {
setBuildTarget('site'); setBuildTarget('site');
@ -144,6 +156,11 @@ export function getViteConfigForSiteDev(): InlineConfig {
return { return {
root: SITE_SRC_DIR, root: SITE_SRC_DIR,
optimizeDeps: {
// https://github.com/youzan/vant/issues/10930
include: ['vue', 'vue-router'],
},
plugins: [ plugins: [
vitePluginGenVantBaseCode(), vitePluginGenVantBaseCode(),
vitePluginVue({ vitePluginVue({
@ -172,18 +189,16 @@ export function getViteConfigForSiteDev(): InlineConfig {
}, },
}), }),
vitePluginJsx(), vitePluginJsx(),
injectHtml({ vitePluginHTML({
data: { ...siteConfig,
...siteConfig, title,
title, // `description` is used by the HTML ejs template,
// `description` is used by the HTML ejs template, // so it needs to be written explicitly here to avoid error: description is not defined
// so it needs to be written explicitly here to avoid error: description is not defined description: siteConfig.description,
description: siteConfig.description, headHtml,
headHtml, baiduAnalytics,
baiduAnalytics, enableVConsole,
enableVConsole, meta: getHTMLMeta(vantConfig),
meta: getHTMLMeta(vantConfig),
},
}), }),
], ],

View File

@ -1,6 +1,6 @@
// @ts-ignore // @ts-ignore
import fs from 'fs'; import fs from 'node:fs';
import { URL, fileURLToPath } from 'url'; import { URL, fileURLToPath } from 'node:url';
const packagePath = fileURLToPath(new URL('../package.json', import.meta.url)); const packagePath = fileURLToPath(new URL('../package.json', import.meta.url));
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8')); const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8'));

View File

@ -1,5 +1,4 @@
// some modules with missing type definitions // some modules with missing type definitions
declare module 'execa';
declare module 'hash-sum'; declare module 'hash-sum';
declare module '@babel/core'; declare module '@babel/core';
declare module 'release-it'; declare module 'release-it';

View File

@ -36,17 +36,18 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@vue/runtime-core": "^3.2.27", "@vue/runtime-core": "^3.3.4",
"vant": "workspace:*", "vant": "workspace:*",
"vue": "^3.2.27", "vue": "^3.3.4",
"esbuild": "^0.14.29", "esbuild": "^0.17.12",
"release-it": "^15.1.1", "release-it": "^15.1.1",
"typescript": "^4.7.4" "rimraf": "^5.0.0",
"typescript": "^5.0.4"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/compat ${version}" "commitMessage": "release: @vant/compat v${version}"
} }
} }
} }

View File

@ -20,17 +20,18 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.36.1", "@typescript-eslint/parser": "^5.48.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-vue": "^9.4.0" "eslint-plugin-vue": "^9.8.0"
}, },
"devDependencies": { "devDependencies": {
"enhanced-resolve": "^5.10.0", "enhanced-resolve": "^5.12.0",
"eslint": "^8.23.0", "eslint": "^8.31.0",
"typescript": "^4.8.2" "jest": "^29.3.1",
"typescript": "^5.0.4"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^7.32.0 || ^8.2.0" "eslint": "^7.32.0 || ^8.2.0"

View File

@ -24,7 +24,6 @@ test('a vue project should pass lint', async () => {
expect([ expect([
'no-const-assign', 'no-const-assign',
'@typescript-eslint/no-unused-vars', '@typescript-eslint/no-unused-vars',
'vue/multi-word-component-names',
'no-undef', 'no-undef',
]).toEqual(rest); ]).toEqual(rest);
}); });
@ -34,7 +33,6 @@ test('a vue-tsx project should pass lint', async () => {
expect([ expect([
'@typescript-eslint/no-unused-vars', '@typescript-eslint/no-unused-vars',
'vue/multi-word-component-names',
'vue/no-ref-as-operand', 'vue/no-ref-as-operand',
'@typescript-eslint/no-empty-interface', '@typescript-eslint/no-empty-interface',
]).toEqual(rest); ]).toEqual(rest);

View File

@ -1,5 +1,14 @@
## Changelog ## Changelog
## 2.0.1
- add woff format back to be compatible with some special webview
## 2.0.0
- no longer support woff/ttf format
- fix delete / delete-o icon
## 1.8.0 ## 1.8.0
- add qq icon - add qq icon

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/icons", "name": "@vant/icons",
"version": "1.8.0", "version": "2.0.1",
"description": "vant icons", "description": "vant icons",
"main": "./src/config.js", "main": "./src/config.js",
"types": "./src/config.d.ts", "types": "./src/config.d.ts",
@ -28,7 +28,7 @@
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/icons ${version}", "commitMessage": "release: @vant/icons v${version}",
"addUntrackedFiles": true, "addUntrackedFiles": true,
"requireCleanWorkingDir": false "requireCleanWorkingDir": false
} }

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
// deprecated

View File

@ -5,10 +5,8 @@
font-style: normal; font-style: normal;
font-display: auto; font-display: auto;
font-family: 'vant-icon'; font-family: 'vant-icon';
src: url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.woff2?t=1649083952952') src: url('//at.alicdn.com/t/c/font_2553510_ovbl29ce9ud.woff2?t=1672541115585')
format('woff2'), format('woff2'),
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.woff?t=1649083952952') url('//at.alicdn.com/t/c/font_2553510_ovbl29ce9ud.woff?t=1672541115585')
format('woff'), format('woff');
url('https://at.alicdn.com/t/font_2553510_iv4v8nulyz.ttf?t=1649083952952')
format('truetype');
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/popperjs", "name": "@vant/popperjs",
"version": "1.2.1", "version": "1.3.0",
"description": "Pre-compiled popperjs core", "description": "Pre-compiled popperjs core",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs", "module": "dist/index.esm.mjs",
@ -36,18 +36,17 @@
"bugs": "https://github.com/vant-ui/vant/issues", "bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.6"
},
"devDependencies": { "devDependencies": {
"esbuild": "^0.14.54", "@popperjs/core": "^2.11.6",
"esbuild": "^0.17.12",
"release-it": "^15.4.1", "release-it": "^15.4.1",
"typescript": "^4.8.2" "rimraf": "^5.0.0",
"typescript": "^5.0.4"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/popperjs ${version}" "commitMessage": "release: @vant/popperjs v${version}"
} }
} }
} }

View File

@ -1,6 +1,6 @@
import { createPopper } from '@popperjs/core/lib/popper-lite'; import { createPopper } from '@popperjs/core/lib/popper-lite';
import offsetModifier from '@popperjs/core/lib/modifiers/offset'; import offsetModifier from '@popperjs/core/lib/modifiers/offset';
import type { Instance, Placement } from '@popperjs/core'; import type { Instance } from '@popperjs/core';
export { createPopper, offsetModifier }; export { createPopper, offsetModifier };
export type { Instance, Placement }; export type { Instance };

View File

@ -1,13 +1,11 @@
const { build } = require('esbuild'); const { build, context } = require('esbuild');
function bundleBundle(format) { async function bundle(format) {
const ext = format === 'esm' ? '.mjs' : '.js'; const ext = format === 'esm' ? '.mjs' : '.js';
const outfile = `dist/index.${format}${ext}`; const outfile = `dist/index.${format}${ext}`;
const finish = () => console.log('Build finished:', outfile); const finish = () => console.log('Build finished:', outfile);
const onRebuild = (error) => (error ? console.log(error) : finish());
build({ const options = {
watch: process.argv.includes('-w') && { onRebuild },
format, format,
bundle: true, bundle: true,
target: ['chrome53'], target: ['chrome53'],
@ -16,8 +14,27 @@ function bundleBundle(format) {
charset: 'utf8', charset: 'utf8',
external: ['vue', 'vant'], external: ['vue', 'vant'],
entryPoints: ['./src/index.ts'], entryPoints: ['./src/index.ts'],
}).then(finish); };
if (process.argv.includes('-w')) {
const loggerPlugin = {
name: 'loggerPlugin',
setup(build) {
build.onEnd(finish);
},
};
const ctx = await context({
...options,
plugins: [loggerPlugin],
});
await ctx.watch();
} else {
await build(options);
finish();
}
} }
bundleBundle('esm'); bundle('esm');
bundleBundle('cjs'); bundle('cjs');

View File

@ -1,5 +1,25 @@
# Changelog # Changelog
## v1.5.1
- add `vue` as peer dependencies
## v1.5.0
- `useEventListener` now returns a cleanup function
## v1.4.4
- Fix `useChildren` not sort children correctly
## v1.4.3
- improve `useEventListener` typing
## v1.4.2
- `useClickAway` support multiple targets
## v1.4.1 ## v1.4.1
- Add `exports` field to package.json, support nuxt 3. - Add `exports` field to package.json, support nuxt 3.

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/use", "name": "@vant/use",
"version": "1.4.2", "version": "1.5.1",
"description": "Vant Composition API", "description": "Vant Composition API",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs", "module": "dist/index.esm.mjs",
@ -37,15 +37,19 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"esbuild": "^0.14.54", "esbuild": "^0.17.12",
"release-it": "^15.4.1", "release-it": "^15.4.1",
"typescript": "^4.8.2", "rimraf": "^5.0.0",
"vue": "^3.2.38" "typescript": "^5.0.4",
"vue": "^3.3.4"
},
"peerDependencies": {
"vue": "^3.0.0"
}, },
"release-it": { "release-it": {
"git": { "git": {
"tag": false, "tag": false,
"commitMessage": "release: @vant/use ${version}" "commitMessage": "release: @vant/use v${version}"
} }
} }
} }

View File

@ -1,4 +1,12 @@
import { Ref, watch, isRef, unref, onUnmounted, onDeactivated } from 'vue'; import {
Ref,
watch,
isRef,
unref,
onUnmounted,
onDeactivated,
type WatchStopHandle,
} from 'vue';
import { onMountedOrActivated } from '../onMountedOrActivated'; import { onMountedOrActivated } from '../onMountedOrActivated';
import { inBrowser } from '../utils'; import { inBrowser } from '../utils';
@ -14,12 +22,12 @@ export function useEventListener<K extends keyof DocumentEventMap>(
type: K, type: K,
listener: (event: DocumentEventMap[K]) => void, listener: (event: DocumentEventMap[K]) => void,
options?: UseEventListenerOptions options?: UseEventListenerOptions
): void; ): () => void;
export function useEventListener( export function useEventListener(
type: string, type: string,
listener: EventListener, listener: EventListener,
options?: UseEventListenerOptions options?: UseEventListenerOptions
): void; ): () => void;
export function useEventListener( export function useEventListener(
type: string, type: string,
listener: EventListener, listener: EventListener,
@ -31,9 +39,13 @@ export function useEventListener(
const { target = window, passive = false, capture = false } = options; const { target = window, passive = false, capture = false } = options;
let cleaned = false;
let attached: boolean; let attached: boolean;
const add = (target?: TargetRef) => { const add = (target?: TargetRef) => {
if (cleaned) {
return;
}
const element = unref(target); const element = unref(target);
if (element && !attached) { if (element && !attached) {
@ -46,6 +58,9 @@ export function useEventListener(
}; };
const remove = (target?: TargetRef) => { const remove = (target?: TargetRef) => {
if (cleaned) {
return;
}
const element = unref(target); const element = unref(target);
if (element && attached) { if (element && attached) {
@ -58,10 +73,21 @@ export function useEventListener(
onDeactivated(() => remove(target)); onDeactivated(() => remove(target));
onMountedOrActivated(() => add(target)); onMountedOrActivated(() => add(target));
let stopWatch: WatchStopHandle;
if (isRef(target)) { if (isRef(target)) {
watch(target, (val, oldVal) => { stopWatch = watch(target, (val, oldVal) => {
remove(oldVal); remove(oldVal);
add(val); add(val);
}); });
} }
/**
* Clean up the event listener
*/
return () => {
stopWatch?.();
remove(target);
cleaned = true;
};
} }

View File

@ -37,6 +37,20 @@ export function flattenVNodes(children: VNodeNormalizedChildren) {
return result; return result;
} }
const findVNodeIndex = (vnodes: VNode[], vnode: VNode) => {
const index = vnodes.indexOf(vnode);
if (index === -1) {
return vnodes.findIndex(
(item) =>
vnode.key !== undefined &&
vnode.key !== null &&
item.type === vnode.type &&
item.key === vnode.key
);
}
return index;
};
// sort children instances by vnodes order // sort children instances by vnodes order
export function sortChildren( export function sortChildren(
parent: ComponentInternalInstance, parent: ComponentInternalInstance,
@ -46,7 +60,7 @@ export function sortChildren(
const vnodes = flattenVNodes(parent.subTree.children); const vnodes = flattenVNodes(parent.subTree.children);
internalChildren.sort( internalChildren.sort(
(a, b) => vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode) (a, b) => findVNodeIndex(vnodes, a.vnode) - findVNodeIndex(vnodes, b.vnode)
); );
const orderedPublicChildren = internalChildren.map((item) => item.proxy!); const orderedPublicChildren = internalChildren.map((item) => item.proxy!);

View File

@ -1,4 +0,0 @@
node_modules
dist
lib
*.tsx

View File

@ -132,7 +132,7 @@ module.exports = {
### Adapt to PC Browsers ### Adapt to PC Browsers
Vant is a mobile-first component library, if you want to use Vant in PC browsers, you can use the [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) module. This module will automatically convert the mouse events of the PC browser into the touch events of the mobile browser. Vant is a mobile-first component library, if you want to use Vant in PC browsers, you can use the [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/main/packages/vant-touch-emulator) module. This module will automatically convert the mouse events of the PC browser into the touch events of the mobile browser.
```bash ```bash
# Install # Install

View File

@ -197,7 +197,7 @@ module.exports = {
Vant 是一个面向移动端的组件库,因此默认只适配了移动端设备,这意味着组件只监听了移动端的 `touch` 事件,没有监听桌面端的 `mouse` 事件。 Vant 是一个面向移动端的组件库,因此默认只适配了移动端设备,这意味着组件只监听了移动端的 `touch` 事件,没有监听桌面端的 `mouse` 事件。
如果你需要在桌面端使用 Vant可以引入我们提供的 [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator),这个库会在桌面端自动将 `mouse` 事件转换成对应的 `touch` 事件,使得组件能够在桌面端使用。 如果你需要在桌面端使用 Vant可以引入我们提供的 [@vant/touch-emulator](https://github.com/vant-ui/vant/tree/main/packages/vant-touch-emulator),这个库会在桌面端自动将 `mouse` 事件转换成对应的 `touch` 事件,使得组件能够在桌面端使用。
```bash ```bash
# 安装模块 # 安装模块

View File

@ -19,6 +19,462 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details ## Details
### [v4.4.1](https://github.com/vant-ui/vant/compare/v4.4.0...v4.4.1)
`2023-05-28`
**Feature**
- Popover: add actions-direction prop [#11888](https://github.com/vant-ui/vant/issues/11888)
**Bug Fixes**
- ImagePreview: stop animation during initialization [#11897](https://github.com/vant-ui/vant/issues/11897)
- Popup: opened event is emitted twice when duration is 0 [#11902](https://github.com/vant-ui/vant/issues/11902)
- Slider: should update startValue when the slider is clicked [#11904](https://github.com/vant-ui/vant/issues/11904)
- Tab: maximum recursive updates exceeded in Tabs [#11898](https://github.com/vant-ui/vant/issues/11898)
### [v4.4.0](https://github.com/vant-ui/vant/compare/v4.3.2...v4.4.0)
`2023-05-21`
**New Component**
- add new Barrage component, contributed by [@zhousg](https://github.com/zhousg) ❤️ [#11760](https://github.com/vant-ui/vant/issues/11760)
**Feature**
- Cascader: scroll the selected option into view when switching tabs [#11869](https://github.com/vant-ui/vant/issues/11869)
- Divider: add vertical prop [#11883](https://github.com/vant-ui/vant/issues/11883)
- Document: sync mobile position on anchor click [#11879](https://github.com/vant-ui/vant/issues/11879)
- ImagePreview: optimize the preview effect of long images [#11857](https://github.com/vant-ui/vant/issues/11857)
- Signature: improve signature clarity by devicePixelRatio [#11835](https://github.com/vant-ui/vant/issues/11835)
- Uploader: add reupload prop [#11854](https://github.com/vant-ui/vant/issues/11854)
**Bug Fixes**
- AddressEdit: should hide border of the last cell [#11872](https://github.com/vant-ui/vant/issues/11872)
- Area: areaProps omit allow-html show-toolbar [#11871](https://github.com/vant-ui/vant/issues/11871)
- BackTop: use the closest parent scroll element as target [#11858](https://github.com/vant-ui/vant/issues/11858)
- ContactList: increase right icon size and optimize styles [#11873](https://github.com/vant-ui/vant/issues/11873)
- DatePicker: should display correctly when modelValue is updated from external [#11839](https://github.com/vant-ui/vant/issues/11839)
- Dialog: fix the rounded corners of shadow when button is clicked [#11863](https://github.com/vant-ui/vant/issues/11863)
### [v4.3.2](https://github.com/vant-ui/vant/compare/v4.3.1...v4.3.2)
`2023-05-14`
**Feature**
- ImagePreview: use the touched point as the center of zooming [#11848](https://github.com/vant-ui/vant/issues/11848)
- PickerGroup: the tab of PickerGroup supports controlled mode [#11771](https://github.com/vant-ui/vant/issues/11771)
- Checkbox: disabled unchecked options when the limit is exceeded [#11814](https://github.com/vant-ui/vant/issues/11814)
**Bug Fixes**
- Filed: onclick label execute twice [#11838](https://github.com/vant-ui/vant/issues/11838)
- Steps: fix the style that occurs when there is only one step [#11822](https://github.com/vant-ui/vant/issues/11822)
- SubmitBar: Unused CSS variables [#11845](https://github.com/vant-ui/vant/issues/11845)
- Tab: should cancel raf before the next scroll [#11819](https://github.com/vant-ui/vant/issues/11819)
### [v4.3.1](https://github.com/vant-ui/vant/compare/v4.3.0...v4.3.1)
`2023-05-04`
**Bug Fixes**
- Fix failed to install Vant v4.3.0 [#11815](https://github.com/vant-ui/vant/issues/11815)
### [v4.3.0](https://github.com/vant-ui/vant/compare/v4.2.1...v4.3.0)
`2023-05-03`
**New Component**
- add new Signature component, contributed by [@LIjiAngChen8](https://github.com/LIjiAngChen8) ❤️ [#11733](https://github.com/vant-ui/vant/issues/11733)
**Feature**
- Field: increase default icon size to 18px [#11799](https://github.com/vant-ui/vant/issues/11799)
**Bug Fixes**
- Field: disabled cursor should be not-allowed [#11800](https://github.com/vant-ui/vant/issues/11800)
- Image: failed to display loading when using lazy-load [#11809](https://github.com/vant-ui/vant/issues/11809)
### [v4.2.1](https://github.com/vant-ui/vant/compare/v4.2.0...v4.2.1)
`2023-04-30`
**Feature**
- Pagination: add show-prev-button, show-next-button props [#11780](https://github.com/vant-ui/vant/issues/11780)
- Picker: add scroll-into event [#11757](https://github.com/vant-ui/vant/issues/11757)
**Bug Fixes**
- Pagination: don't show click feedback when button is disabled [#11779](https://github.com/vant-ui/vant/issues/11779)
- Sticky: resize or orientationchange wrapper no reset width and height [#11753](https://github.com/vant-ui/vant/issues/11753)
- Tabs: re-render when line-width or line-height changed [#11776](https://github.com/vant-ui/vant/issues/11776)
- Tabs: should scroll active tab into view after resized [#11777](https://github.com/vant-ui/vant/issues/11777)
- Watermark: add xlink namespace and fix blob MIME type [#11762](https://github.com/vant-ui/vant/issues/11762)
### [v4.2.0](https://github.com/vant-ui/vant/compare/v4.1.2...v4.2.0)
`2023-04-16`
**New Component**
- add new Watermark component, contributed by [@HuberTRoy](https://github.com/HuberTRoy) ❤️ [#11721](https://github.com/vant-ui/vant/issues/11721)
**Feature**
- ShareSheet: allow custom icon [#11709](https://github.com/vant-ui/vant/issues/11709)
- TextEllipsis: add dots prop [#11745](https://github.com/vant-ui/vant/issues/11745)
**Bug Fixes**
- Swipe: should resize after props.width and props.height changed [#11747](https://github.com/vant-ui/vant/issues/11747)
### [v4.1.2](https://github.com/vant-ui/vant/compare/v4.1.1...v4.1.2)
`2023-03-26`
**Feature**
- Locale: add Khmer translations [#11701](https://github.com/vant-ui/vant/issues/11701)
**Bug Fixes**
- Field: label-align top works well with label-width [#11684](https://github.com/vant-ui/vant/issues/11684)
- Field: should emit blur event when readonly [#11699](https://github.com/vant-ui/vant/issues/11699)
- ImagePreview: long vertical images sliding up and down [#11702](https://github.com/vant-ui/vant/issues/11702)
### [v4.1.1](https://github.com/vant-ui/vant/compare/v4.1.0...v4.1.1)
`2023-03-19`
**Feature**
- Uploader: support avif image format [#11655](https://github.com/vant-ui/vant/issues/11655)
**Bug Fixes**
- @vant/use: add vue as peer dependencies [#11662](https://github.com/vant-ui/vant/issues/11662)
- DatePicker: fix display back wrong of date-picker [#11656](https://github.com/vant-ui/vant/issues/11656)
- Field: fix `FieldRuleFormatter` typo [#11674](https://github.com/vant-ui/vant/issues/11674)
- TextEllipsis: fix that numbers and letters cannot display ellipses [#11669](https://github.com/vant-ui/vant/issues/11669)
### [v4.1.0](https://github.com/vant-ui/vant/compare/v4.0.11...v4.1.0)
`2023-03-05`
**New Component**
- add new TextEllipsis component, contributed by [@wjw-gavin](https://github.com/wjw-gavin) ❤️ [#11593](https://github.com/vant-ui/vant/issues/11593)
**Feature**
- Swipe: add index param to drag-start/drag-end event [#11632](https://github.com/vant-ui/vant/issues/11632)
- TreeSelect: add nav-text slot [#11602](https://github.com/vant-ui/vant/issues/11602) [#11641](https://github.com/vant-ui/vant/issues/11641)
**Bug Fixes**
- DropdownMenu: fix dropdown-item position when expanded by default [#11640](https://github.com/vant-ui/vant/issues/11640)
- Field: fix label-align top not work when set label-width [#11611](https://github.com/vant-ui/vant/issues/11611)
- Locale: improve Ukrainian translation [#11629](https://github.com/vant-ui/vant/issues/11629)
### [v4.0.11](https://github.com/vant-ui/vant/compare/v4.0.10...v4.0.11)
`2023-02-20`
**Feature**
- Add new [vant-nuxt](https://github.com/vant-ui/vant-nuxt) module for Nuxt [#11588](https://github.com/vant-ui/vant/issues/11588)
- BackTop: support css variable and prop of z-index [#11582](https://github.com/vant-ui/vant/issues/11582)
- Picker: expose option index to option slot [#11594](https://github.com/vant-ui/vant/issues/11594)
- @vant/use: support cleanup useEventListener [#11540](https://github.com/vant-ui/vant/issues/11540)
**Bug Fixes**
- PickerGroup: confirm event missing params [#11566](https://github.com/vant-ui/vant/issues/11566)
- PickerGroup: fix style of tab-line caused by v-show [#11547](https://github.com/vant-ui/vant/issues/11547)
- PickerGroup: fix slots not work [#11564](https://github.com/vant-ui/vant/issues/11564)
- Popover: fix the arrow position of `*-start/end` placements [#11584](https://github.com/vant-ui/vant/issues/11584)
- Popover: should update location after transition [#11568](https://github.com/vant-ui/vant/issues/11568)
- Space: Text is not defined in SSR [#11549](https://github.com/vant-ui/vant/issues/11549)
### [v4.0.10](https://github.com/vant-ui/vant/compare/v4.0.9...v4.0.10)
`2023-02-02`
**Bug Fixes**
- DatePicker: fix the value is not updated in time of change event [#11529](https://github.com/vant-ui/vant/issues/11529)
- Slider: fix button does not work properly in two-thumb mode [#11526](https://github.com/vant-ui/vant/issues/11526) [#11534](https://github.com/vant-ui/vant/issues/11534)
### [v4.0.9](https://github.com/vant-ui/vant/compare/v4.0.8...v4.0.9)
`2023-01-26`
**Feature**
- BackTop: add immediate prop [#11515](https://github.com/vant-ui/vant/issues/11515)
- Calendar: add month-title slot [#11500](https://github.com/vant-ui/vant/issues/11500)
- Cascader: add useCascaderAreaData method [#11518](https://github.com/vant-ui/vant/issues/11518)
- ImagePreview: allow swipe when image is moved to edge [#11505](https://github.com/vant-ui/vant/issues/11505)
- Locale: add Esperanto translations [#11520](https://github.com/vant-ui/vant/issues/11520)
- Locale: add useCurrentLang method [#11517](https://github.com/vant-ui/vant/issues/11517)
- Swipe: add drag-start, drag-end event [#11502](https://github.com/vant-ui/vant/issues/11502)
**Bug Fixes**
- ImagePreview: disable zoom when swiping [#11504](https://github.com/vant-ui/vant/issues/11504)
- Locale: fix Italian general revision [#11519](https://github.com/vant-ui/vant/issues/11519)
- Swipe: avoid resetting position on multi-finger touch [#11503](https://github.com/vant-ui/vant/issues/11503)
### [v4.0.8](https://github.com/vant-ui/vant/compare/v4.0.7...v4.0.8)
`2023-01-15`
**Feature**
- PickerGroup: add next-step-text prop [#11487](https://github.com/vant-ui/vant/issues/11487)
**Bug Fixes**
- Picker: change confirm button color to primary color [#11479](https://github.com/vant-ui/vant/issues/11479)
- NumberKeyboard: change confirm button color to primary color [#11479](https://github.com/vant-ui/vant/issues/11479)
- Icons: add woff format to compat some special webview [#11485](https://github.com/vant-ui/vant/issues/11485)
- Picker: ensure title align in center [#11489](https://github.com/vant-ui/vant/issues/11489)
- Skeleton: fix can not register skeleton image component [#11470](https://github.com/vant-ui/vant/issues/11470) [#11469](https://github.com/vant-ui/vant/issues/11469)
- Tabs: incorrect insert position in some cases [#11462](https://github.com/vant-ui/vant/issues/11462)
### [v4.0.7](https://github.com/vant-ui/vant/compare/v4.0.6...v4.0.7)
`2023-01-02`
**Bug Fixes**
- Icons: fix delete / delete-o icon [#11441](https://github.com/vant-ui/vant/issues/11441)
- Icons: no longer support woff/ttf format [#11442](https://github.com/vant-ui/vant/issues/11442)
- ImagePreviewfix teleport prop not work [#11429](https://github.com/vant-ui/vant/issues/11429)
- Locale: fix typo of "Calendar" in ru-RU [#11425](https://github.com/vant-ui/vant/issues/11425)
- Swipe: failed to render inside keep-alive [#11437](https://github.com/vant-ui/vant/issues/11437)
### [v4.0.6](https://github.com/vant-ui/vant/compare/v4.0.5...v4.0.6)
`2022-12-26`
**Bug Fixes**
- Fix missing declaration files caused by upgrading vite v4 [#11423](https://github.com/vant-ui/vant/issues/11423)
### [v4.0.5](https://github.com/vant-ui/vant/compare/v4.0.4...v4.0.5)
`2022-12-25`
**Feature**
- Locale: add Dutch lang [#11419](https://github.com/vant-ui/vant/issues/11419)
- Locale: add Mongolian lang [#11418](https://github.com/vant-ui/vant/issues/11418)
**Bug Fixes**
- Badge: fix badge offset of different position [#11400](https://github.com/vant-ui/vant/issues/11400)
- Form: filter no name field's value [#11410](https://github.com/vant-ui/vant/issues/11410)
- Picker: picker loading color in dark theme [#11405](https://github.com/vant-ui/vant/issues/11405)
### [v4.0.4](https://github.com/vant-ui/vant/compare/v4.0.3...v4.0.4)
`2022-12-23`
**Bug Fixes**
- Field: incorrect cursor position when value length exceeds maxlength or when formatter is used [#11360](https://github.com/vant-ui/vant/issues/11360)
- Image: load event missing params [#11406](https://github.com/vant-ui/vant/issues/11406)
### [v4.0.3](https://github.com/vant-ui/vant/compare/v4.0.2...v4.0.3)
`2022-12-13`
**Bug Fixes**
- Field: failed to dynamically set empty label [#11373](https://github.com/vant-ui/vant/issues/11373)
- ImagePreview: fix loading when previewing images [#11376](https://github.com/vant-ui/vant/issues/11376)
### [v4.0.2](https://github.com/vant-ui/vant/compare/v4.0.1...v4.0.2)
`2022-12-03`
**Bug Fixes**
- Field: incorrect cursor position when using formatter [#11348](https://github.com/vant-ui/vant/issues/11348)
- Image: load event not triggered in nuxt3 [128972](https://github.com/vant-ui/vant/commit/128972a75329d4b14028d00cd23dac66038e2d4c)
- NavBar: update placeholder height when window resized [#11351](https://github.com/vant-ui/vant/issues/11351)
### [v4.0.1](https://github.com/vant-ui/vant/compare/v4.0.0...v4.0.1)
`2022-12-01`
**Feature**
- Picker: add selectedIndexes to the confirm event [#11329](https://github.com/vant-ui/vant/issues/11329)
**Bug Fixes**
- Field: set selection range only when focused [#11333](https://github.com/vant-ui/vant/issues/11333)
### [v4.0.0](https://github.com/vant-ui/vant/compare/v4.0.0-rc.9...v4.0.0)
`2022-11-26`
**Feature**
- List: add disabled prop [#11307](https://github.com/vant-ui/vant/issues/11307)
- BackTop: allow dynamically set target prop [#11311](https://github.com/vant-ui/vant/issues/11311)
- BackTop: allow using css var to custom position [#11312](https://github.com/vant-ui/vant/issues/11312)
- BackTop: rename visibility-height prop to offset [#11309](https://github.com/vant-ui/vant/issues/11309)
**Bug Fixes**
- Field: keep selection position after updating value [#11308](https://github.com/vant-ui/vant/issues/11308)
### [v4.0.0-rc.9](https://github.com/vant-ui/vant/compare/v4.0.0-rc.8...v4.0.0-rc.9)
`2022-11-24`
**Bug Fixes**
- Cell: arrow-direction assignment right is invalid [#11279](https://github.com/vant-ui/vant/issues/11279)
- Style: body normalize not work [#11287](https://github.com/vant-ui/vant/issues/11287)
### [v4.0.0-rc.8](https://github.com/vant-ui/vant/compare/v4.0.0-rc.7...v4.0.0-rc.8)
`2022-11-20`
**Feature**
- add new BackTop component, note that the API is not stable yet, we may change the API before 4.0 release. [#11236](https://github.com/vant-ui/vant/issues/11236)
**Bug Fixes**
- DropdownItem: should inherit attrs when using teleport [#11273](https://github.com/vant-ui/vant/issues/11273)
- List: incorrect initial loading value [#11275](https://github.com/vant-ui/vant/issues/11275)
- NumberKeyboard: should inherit attrs when using teleport [#11274](https://github.com/vant-ui/vant/issues/11274)
### [v4.0.0-rc.7](https://github.com/vant-ui/vant/compare/v4.0.0-rc.6...v4.0.0-rc.7)
`2022-11-13`
**New Component**
- Add new SkeletonAvatar、SkeletonTitle、SkeletonImage、SkeletonParagraph components [#11173](https://github.com/vant-ui/vant/issues/11173)
**Feature**
- ImagePreview: add long-press event [#11252](https://github.com/vant-ui/vant/issues/11252)
- Popover: support uncontrolled mode [#11244](https://github.com/vant-ui/vant/issues/11244)
**Bug Fixes**
- ActionSheet: fix that close is invalid without title [#11213](https://github.com/vant-ui/vant/issues/11213)
- DatePicker: only throw error in development [#11248](https://github.com/vant-ui/vant/issues/11248)
- Lazyload: lazy-image h is not a function [#11229](https://github.com/vant-ui/vant/issues/11229)
- Picker: correct v-model when emit confirm event [#11194](https://github.com/vant-ui/vant/issues/11194)
- Picker: empty column will cause error [#11249](https://github.com/vant-ui/vant/issues/11249)
- Uploader: chooseFile is invalid when show-upload is false [#11218](https://github.com/vant-ui/vant/issues/11218)
### [v4.0.0-rc.6](https://github.com/vant-ui/vant/compare/v4.0.0-rc.5...v4.0.0-rc.6)
`2022-10-23`
**Feature**
- Calendar: add params for subtitle slot [#11168](https://github.com/vant-ui/vant/issues/11168)
- Cell: add tag prop [#11139](https://github.com/vant-ui/vant/issues/11139)
- ImagePreview: add image slot [#11133](https://github.com/vant-ui/vant/issues/11133)
- Toast: add wordBreak prop [#11147](https://github.com/vant-ui/vant/issues/11147)
**Bug Fixes**
- CouponList: fix the style of coupon checkbox [#11153](https://github.com/vant-ui/vant/issues/11153)
- CouponList: incorrect field style [#11155](https://github.com/vant-ui/vant/issues/11155)
- Swipe: failed to render when inside popup [#11162](https://github.com/vant-ui/vant/issues/11162)
### [v4.0.0-rc.5](https://github.com/vant-ui/vant/compare/v4.0.0-rc.4...v4.0.0-rc.5)
`2022-10-07`
**Feature**
- Field: support label-position top [#11102](https://github.com/vant-ui/vant/issues/11102)
- Loading: add icon slot [#11109](https://github.com/vant-ui/vant/issues/11109)
- NavBar: add clickable prop [#11048](https://github.com/vant-ui/vant/issues/11048)
- Stepper: add auto-fixed prop [#11071](https://github.com/vant-ui/vant/issues/11071)
**Bug Fixes**
- DatePicker: format value when exceed max date [#11122](https://github.com/vant-ui/vant/issues/11122)
- Tabs: incorrect nav scroll animation in some cases [#11116](https://github.com/vant-ui/vant/issues/11116)
- Tabs: scroll position when using nav-bottom slot [#11115](https://github.com/vant-ui/vant/issues/11115)
### [v4.0.0-rc.4](https://github.com/vant-ui/vant/compare/v4.0.0-rc.3...v4.0.0-rc.4)
`2022-09-25`
**Feature**
- Field: add message param to 'end-validate' method [#11080](https://github.com/vant-ui/vant/issues/11080)
**Bug Fixes**
- Tabs: incorrect scroll position in some cases [#11085](https://github.com/vant-ui/vant/issues/11085)
- Tabs: incorrect scroll position when inited [#11059](https://github.com/vant-ui/vant/issues/11059)
### [v4.0.0-rc.3](https://github.com/vant-ui/vant/compare/v4.0.0-rc.2...v4.0.0-rc.3)
`2022-09-12`
**Feature**
- ConfigProvider: add ConfigProviderThemeVars type [#11034](https://github.com/vant-ui/vant/issues/11034)
- Notify: add z-index prop [#11032](https://github.com/vant-ui/vant/issues/11032)
- remove popperjs to reduce install size [#11030](https://github.com/vant-ui/vant/issues/11030)
**Types**
- Toast: fix missing global components type [#11033](https://github.com/vant-ui/vant/issues/11033)
### [v4.0.0-rc.2](https://github.com/vant-ui/vant/compare/v4.0.0-rc.1...v4.0.0-rc.2)
`2022-09-11`
**Breaking Changes**
- attach css variables to :root element [#11026](https://github.com/vant-ui/vant/issues/11026)
**Bug Fixes**
- Dialog: incorrect transform behavior [#11028](https://github.com/vant-ui/vant/issues/11028)
- Empty: fix opacity in dark mode [#11027](https://github.com/vant-ui/vant/issues/11027)
### [v4.0.0-rc.1](https://github.com/vant-ui/vant/compare/v4.0.0-rc.0...v4.0.0-rc.1)
`2022-09-10`
**Feature**
- export props of all components [#11024](https://github.com/vant-ui/vant/issues/11024)
- Dialog: message-align can be justify [#11014](https://github.com/vant-ui/vant/issues/11014)
- Image: add block prop [#11022](https://github.com/vant-ui/vant/issues/11022)
- Toast: add message slot [#11018](https://github.com/vant-ui/vant/issues/11018)
**Bug Fixes**
- Picker: failed to update value in some cases [#11009](https://github.com/vant-ui/vant/issues/11009)
- Locale: avoid getting unexpected value [#11010](https://github.com/vant-ui/vant/issues/11010)
### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0) ### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0)
`2022-09-04` `2022-09-04`
@ -60,7 +516,7 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
**New Component** **New Component**
- Add new component [Space](#/en-US/space), contributed by [@LadyChatterleyLover](https://github.com/LadyChatterleyLover) [#10857](https://github.com/vant-ui/vant/issues/10857) - Add new component [Space](#/en-US/space), contributed by [@LadyChatterleyLover](https://github.com/LadyChatterleyLover) [#10857](https://github.com/vant-ui/vant/issues/10857) ❤️
**Feature** **Feature**

View File

@ -19,6 +19,464 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容 ## 更新内容
### [v4.4.1](https://github.com/vant-ui/vant/compare/v4.4.0...v4.4.1)
`2023-05-28`
**Feature**
- Popover: 新增 actions-direction 属性 [#11888](https://github.com/vant-ui/vant/issues/11888)
**Bug Fixes**
- ImagePreview: 修复初始化时可能有过渡动画的问题 [#11897](https://github.com/vant-ui/vant/issues/11897)
- Popup: 修复 duration 为 0 时 opened 事件触发两次的问题 [#11902](https://github.com/vant-ui/vant/issues/11902)
- Slider: 修复点击可能无法触发 change 事件的问题 [#11904](https://github.com/vant-ui/vant/issues/11904)
- Tab: 修复 title-class 和 title-style 属性可能导致死循环的问题 [#11898](https://github.com/vant-ui/vant/issues/11898)
### [v4.4.0](https://github.com/vant-ui/vant/compare/v4.3.2...v4.4.0)
`2023-05-21`
**New Component**
- 新增 Barrage 组件,由 [@zhousg](https://github.com/zhousg) 贡献 ❤️ [#11760](https://github.com/vant-ui/vant/issues/11760)
**Feature**
- Cascader: 切换 Tab 时自动滚动到选中项 [#11869](https://github.com/vant-ui/vant/issues/11869)
- Divider: 新增 vertical 属性 [#11883](https://github.com/vant-ui/vant/issues/11883)
- Document: 支持点击标题时自动调整右侧示例到相应的位置 [#11879](https://github.com/vant-ui/vant/issues/11879)
- ImagePreview: 优化长图的默认展示效果 [#11857](https://github.com/vant-ui/vant/issues/11857)
- Signature: 优化签名的清晰度 [#11835](https://github.com/vant-ui/vant/issues/11835)
- Uploader: 新增 reupload prop [#11854](https://github.com/vant-ui/vant/issues/11854)
**Bug Fixes**
- AddressEdit: 修复多余的底部边框 [#11872](https://github.com/vant-ui/vant/issues/11872)
- Area: 修复多余的 allow-html 和 show-toolbar props 定义 [#11871](https://github.com/vant-ui/vant/issues/11871)
- BackTop: 默认使用最近的父级滚动元素作为 target [#11858](https://github.com/vant-ui/vant/issues/11858)
- ContactList: 优化样式和图标大小 [#11873](https://github.com/vant-ui/vant/issues/11873)
- DatePicker: 修复外部设置 modelValue 时展示错误的问题 [#11839](https://github.com/vant-ui/vant/issues/11839)
- Dialog: 修复点击按钮时圆角错误的问题 [#11863](https://github.com/vant-ui/vant/issues/11863)
### [v4.3.2](https://github.com/vant-ui/vant/compare/v4.3.1...v4.3.2)
`2023-05-14`
**Feature**
- ImagePreview: 支持基于手指位置进行缩放 [#11848](https://github.com/vant-ui/vant/issues/11848)
- PickerGroup: 支持控制当前 Tab 的位置 [#11771](https://github.com/vant-ui/vant/issues/11771)
- Checkbox: 支持在达到最大选择数量时自动禁用其他选项 [#11814](https://github.com/vant-ui/vant/issues/11814)
**Bug Fixes**
- Filed: 修复点击 label 会触发两次 click 事件的问题 [#11838](https://github.com/vant-ui/vant/issues/11838)
- Steps: 修复只有一个 Step 时样式错误的问题 [#11822](https://github.com/vant-ui/vant/issues/11822)
- SubmitBar: 移除多余的 CSS 变量 [#11845](https://github.com/vant-ui/vant/issues/11845)
- Tab: 修复下划线动画可能错误的问题 [#11819](https://github.com/vant-ui/vant/issues/11819)
### [v4.3.1](https://github.com/vant-ui/vant/compare/v4.3.0...v4.3.1)
`2023-05-04`
**Bug Fixes**
- 修复安装 Vant v4.3.0 失败的问题 [#11815](https://github.com/vant-ui/vant/issues/11815)
### [v4.3.0](https://github.com/vant-ui/vant/compare/v4.2.1...v4.3.0)
`2023-05-03`
**New Component**
- 新增 Signature 组件, 由 [@LIjiAngChen8](https://github.com/LIjiAngChen8) 贡献 ❤️ [#11733](https://github.com/vant-ui/vant/issues/11733)
**Feature**
- Field: 图标的默认大小增加为 18px [#11799](https://github.com/vant-ui/vant/issues/11799)
**Bug Fixes**
- Field: 修复禁用状态下光标显示不正确的问题 [#11800](https://github.com/vant-ui/vant/issues/11800)
- Image: 修复开启 lazy-load 时无法显示加载中状态的问题 [#11809](https://github.com/vant-ui/vant/issues/11809)
### [v4.2.1](https://github.com/vant-ui/vant/compare/v4.2.0...v4.2.1)
`2023-04-30`
**Feature**
- Pagination: 新增 show-prev-button, show-next-button 属性 [#11780](https://github.com/vant-ui/vant/issues/11780)
- Picker: 新增 scroll-into 事件 [#11757](https://github.com/vant-ui/vant/issues/11757)
**Bug Fixes**
- Pagination: 修复点击禁用后的按钮时存在点击反馈的问题 [#11779](https://github.com/vant-ui/vant/issues/11779)
- Sticky: 修复屏幕宽度变化时不会更新组件宽度的问题 [#11753](https://github.com/vant-ui/vant/issues/11753)
- Tabs: 修复动态设置 line-width 或 line-height 不会重新渲染的问题 [#11776](https://github.com/vant-ui/vant/issues/11776)
- Tabs: 修复屏幕宽度变化时不会自动滚动到激活的标签页的问题 [#11777](https://github.com/vant-ui/vant/issues/11777)
- Watermark: 修复 iOS 12 系统的兼容性问题 [#11762](https://github.com/vant-ui/vant/issues/11762)
### [v4.2.0](https://github.com/vant-ui/vant/compare/v4.1.2...v4.2.0)
`2023-04-16`
**New Component**
- 新增 Watermark 水印组件,由 [@HuberTRoy](https://github.com/HuberTRoy) 贡献 ❤️ [#11721](https://github.com/vant-ui/vant/issues/11721)
**Feature**
- ShareSheet: 支持自定义 icon [#11709](https://github.com/vant-ui/vant/issues/11709)
- TextEllipsis: 新增 dots 属性 [#11745](https://github.com/vant-ui/vant/issues/11745)
**Bug Fixes**
- Swipe: 修复 width 和 height 属性变化后未重新渲染的问题 [#11747](https://github.com/vant-ui/vant/issues/11747)
### [v4.1.2](https://github.com/vant-ui/vant/compare/v4.1.1...v4.1.2)
`2023-03-26`
**Feature**
- Locale: 增加 Khmer 高棉语 [#11701](https://github.com/vant-ui/vant/issues/11701)
**Bug Fixes**
- Field: 修复同时设置 label-align "top" 和 is-link 时样式错误的问题 [#11684](https://github.com/vant-ui/vant/issues/11684)
- Field: 修复设置 readonly 属性后无法触发 blur 事件的问题 [#11699](https://github.com/vant-ui/vant/issues/11699)
- ImagePreview: 修复长图片上下拖动不顺滑的问题 [#11702](https://github.com/vant-ui/vant/issues/11702)
### [v4.1.1](https://github.com/vant-ui/vant/compare/v4.1.0...v4.1.1)
`2023-03-19`
**Feature**
- Uploader: 支持 avif 图片格式 [#11655](https://github.com/vant-ui/vant/issues/11655)
**Bug Fixes**
- @vant/use: 增加 vue 作为 peer dependencies [#11662](https://github.com/vant-ui/vant/issues/11662)
- DatePicker: 修复个别情况下显示时间错误的问题 [#11656](https://github.com/vant-ui/vant/issues/11656)
- Field: 修复 `FieldRuleFormatter` 类型拼写错误 [#11674](https://github.com/vant-ui/vant/issues/11674)
- TextEllipsis: 修复长数字无法被正确截断的问题 [#11669](https://github.com/vant-ui/vant/issues/11669)
### [v4.1.0](https://github.com/vant-ui/vant/compare/v4.0.11...v4.1.0)
`2023-03-05`
**New Component**
- 新增 TextEllipsis 文本省略组件,由 [@wjw-gavin](https://github.com/wjw-gavin) 贡献 ❤️ [#11593](https://github.com/vant-ui/vant/issues/11593)
**Feature**
- Swipe: 新增 drag-start/drag-end 事件的 index 参数 [#11632](https://github.com/vant-ui/vant/issues/11632)
- TreeSelect: 新增 nav-text 插槽 [#11602](https://github.com/vant-ui/vant/issues/11602) [#11641](https://github.com/vant-ui/vant/issues/11641)
**Bug Fixes**
- DropdownMenu: 修复使用 toggle 方法打开时位置错误的问题 [#11640](https://github.com/vant-ui/vant/issues/11640)
- Field: 修复设置 label-width 后 label-position 不生效的问题 [#11611](https://github.com/vant-ui/vant/issues/11611)
- Locale: 修复乌克兰语翻译问题 [#11629](https://github.com/vant-ui/vant/issues/11629)
### [v4.0.11](https://github.com/vant-ui/vant/compare/v4.0.10...v4.0.11)
`2023-02-20`
**Feature**
- 新增 [vant-nuxt](https://github.com/vant-ui/vant-nuxt) 包,作为官方的 Nuxt Module [#11588](https://github.com/vant-ui/vant/issues/11588)
- BackTop: 新增 z-index 属性以及相关 CSS 变量 [#11582](https://github.com/vant-ui/vant/issues/11582)
- Picker: 支持在 option 插槽中获取选项的 index [#11594](https://github.com/vant-ui/vant/issues/11594)
- @vant/use: 支持注销 useEventListener [#11540](https://github.com/vant-ui/vant/issues/11540)
**Bug Fixes**
- PickerGroup: 修复 confirm 事件参数不正确的问题 [#11566](https://github.com/vant-ui/vant/issues/11566)
- PickerGroup: 修复 Tab 的下划线样式错误问题 [#11547](https://github.com/vant-ui/vant/issues/11547)
- PickerGroup: 修复部分插槽不可用的问题 [#11564](https://github.com/vant-ui/vant/issues/11564)
- Popover: 修复 placement 为 `*-start/end` 时箭头位置错误的问题 [#11584](https://github.com/vant-ui/vant/issues/11584)
- Popover: 修复动画会导致组件位置错误的问题 [#11568](https://github.com/vant-ui/vant/issues/11568)
- Space: 修复 SSR 时出现缺少 Text 报错的问题 [#11549](https://github.com/vant-ui/vant/issues/11549)
### [v4.0.10](https://github.com/vant-ui/vant/compare/v4.0.9...v4.0.10)
`2023-02-02`
**Bug Fixes**
- DatePicker: 修复 change 事件中日期参数不正确的问题 [#11529](https://github.com/vant-ui/vant/issues/11529)
- Slider: 修复双滑块模式下无法正确拖动的问题 [#11526](https://github.com/vant-ui/vant/issues/11526) [#11534](https://github.com/vant-ui/vant/issues/11534)
### [v4.0.9](https://github.com/vant-ui/vant/compare/v4.0.8...v4.0.9)
`2023-01-26`
**Feature**
- BackTop: 新增 immediate 属性 [#11515](https://github.com/vant-ui/vant/issues/11515)
- Calendar: 新增 month-title 插槽 [#11500](https://github.com/vant-ui/vant/issues/11500)
- Cascader: 新增 useCascaderAreaData 方法 [#11518](https://github.com/vant-ui/vant/issues/11518)
- ImagePreview: 支持在缩放图片后滑动至其他图片 [#11505](https://github.com/vant-ui/vant/issues/11505)
- Locale: 新增 Esperanto 世界语 [#11520](https://github.com/vant-ui/vant/issues/11520)
- Locale: 新增 useCurrentLang 方法 [#11517](https://github.com/vant-ui/vant/issues/11517)
- Swipe: 新增 drag-start, drag-end 事件 [#11502](https://github.com/vant-ui/vant/issues/11502)
**Bug Fixes**
- ImagePreview: 修复切换图片过程中可以触发图片缩放的问题 [#11504](https://github.com/vant-ui/vant/issues/11504)
- Locale: 修复意大利语翻译问题 [#11519](https://github.com/vant-ui/vant/issues/11519)
- Swipe: 修复多指操作时滑动位置被错误重置的问题 [#11503](https://github.com/vant-ui/vant/issues/11503)
### [v4.0.8](https://github.com/vant-ui/vant/compare/v4.0.7...v4.0.8)
`2023-01-15`
**Feature**
- PickerGroup: 新增 next-step-text 属性 [#11487](https://github.com/vant-ui/vant/issues/11487)
**Bug Fixes**
- Picker: 调整确认按钮的颜色为 primary color [#11479](https://github.com/vant-ui/vant/issues/11479)
- NumberKeyboard: 调整确认按钮的颜色为 primary color [#11479](https://github.com/vant-ui/vant/issues/11479)
- Icons: 增加 woff 格式来兼容个别 webview 环境 [#11485](https://github.com/vant-ui/vant/issues/11485)
- Picker: 修复标题文字可能不居中的问题 [#11489](https://github.com/vant-ui/vant/issues/11489)
- Skeleton: 修复全量引入组件时不会自动注册 Skeleton 子组件的问题 [#11470](https://github.com/vant-ui/vant/issues/11470) [#11469](https://github.com/vant-ui/vant/issues/11469)
- Tabs: 修复动态插入 Tab 时在个别情况下顺序错误的问题 [#11462](https://github.com/vant-ui/vant/issues/11462)
### [v4.0.7](https://github.com/vant-ui/vant/compare/v4.0.6...v4.0.7)
`2023-01-02`
**Bug Fixes**
- Icons: 修复 delete / delete-o 图标存在多余黑点的问题 [#11441](https://github.com/vant-ui/vant/issues/11441)
- Icons: 移除多余的 woff/ttf 格式声明 [#11442](https://github.com/vant-ui/vant/issues/11442)
- ImagePreview修复 teleport 属性不生效的问题 [#11429](https://github.com/vant-ui/vant/issues/11429)
- Locale: 修复 ru-RU 中的 "Calendar" 拼写错误 [#11425](https://github.com/vant-ui/vant/issues/11425)
- Swipe: 修复在 keep-alive 内使用时可能渲染空白的问题 [#11437](https://github.com/vant-ui/vant/issues/11437)
### [v4.0.6](https://github.com/vant-ui/vant/compare/v4.0.5...v4.0.6)
`2022-12-26`
**Bug Fixes**
- 修复升级 vite v4 导致构建产物不全的问题 [#11423](https://github.com/vant-ui/vant/issues/11423)
### [v4.0.5](https://github.com/vant-ui/vant/compare/v4.0.4...v4.0.5)
`2022-12-25`
**Feature**
- Locale: 新增 Dutch 荷兰语 [#11419](https://github.com/vant-ui/vant/issues/11419)
- Locale: 新增 Mongolian 蒙古语 [#11418](https://github.com/vant-ui/vant/issues/11418)
**Bug Fixes**
- Badge: 修复 offset 属性部分情况下导致样式错误的问题 [#11400](https://github.com/vant-ui/vant/issues/11400)
- Form: 修复事件参数中可能出现 key 为 undefined 的问题 [#11410](https://github.com/vant-ui/vant/issues/11410)
- Picker: 修复深色模式下加载状态样式错误的问题 [#11405](https://github.com/vant-ui/vant/issues/11405)
### [v4.0.4](https://github.com/vant-ui/vant/compare/v4.0.3...v4.0.4)
`2022-12-23`
**Bug Fixes**
- Field: 修复使用 formatter 时光标位置可能错误的问题 [#11360](https://github.com/vant-ui/vant/issues/11360)
- Image: 修复 load 事件未正确触发导致 ImagePreview 报错的问题 [#11406](https://github.com/vant-ui/vant/issues/11406)
### [v4.0.3](https://github.com/vant-ui/vant/compare/v4.0.2...v4.0.3)
`2022-12-13`
**Bug Fixes**
- Field: 修复动态设置空的 label 不生效的问题 [#11373](https://github.com/vant-ui/vant/issues/11373)
- ImagePreview: 修复图片可能加载失败的问题 [#11376](https://github.com/vant-ui/vant/issues/11376)
### [v4.0.2](https://github.com/vant-ui/vant/compare/v4.0.1...v4.0.2)
`2022-12-03`
**Bug Fixes**
- Field: 修复使用 formatter 时光标位置错误的问题 [#11348](https://github.com/vant-ui/vant/issues/11348)
- Image: 修复在 Nuxt 3 下图片可能无法展示的问题 [128972](https://github.com/vant-ui/vant/commit/128972a75329d4b14028d00cd23dac66038e2d4c)
- NavBar: 修复屏幕旋转时 placeholder 未自动适配高度的问题 [#11351](https://github.com/vant-ui/vant/issues/11351)
### [v4.0.1](https://github.com/vant-ui/vant/compare/v4.0.0...v4.0.1)
`2022-12-01`
**Feature**
- Picker: 新增 selectedIndexes 作为事件入参 [#11329](https://github.com/vant-ui/vant/issues/11329)
**Bug Fixes**
- Field: 修复未选中时修改绑定的值会导致键盘弹出的问题 [#11333](https://github.com/vant-ui/vant/issues/11333)
### [v4.0.0](https://github.com/vant-ui/vant/compare/v4.0.0-rc.9...v4.0.0)
`2022-11-26`
> 完整内容请移步:[「4.0 更新介绍」](https://vant-ui.github.io/vant/#/zh-CN/release-note-v4)
**Feature**
- List: 新增 disabled 属性 [#11307](https://github.com/vant-ui/vant/issues/11307)
- BackTop: 支持动态设置 target 属性 [#11311](https://github.com/vant-ui/vant/issues/11311)
- BackTop: 支持通过 CSS 变量修改组件位置 [#11312](https://github.com/vant-ui/vant/issues/11312)
- BackTop: 重命名 visibility-height 属性为 offset [#11309](https://github.com/vant-ui/vant/issues/11309)
**Bug Fixes**
- Field: 修复格式化值后,光标位置错误的问题 [#11308](https://github.com/vant-ui/vant/issues/11308)
### [v4.0.0-rc.9](https://github.com/vant-ui/vant/compare/v4.0.0-rc.8...v4.0.0-rc.9)
`2022-11-24`
**Bug Fixes**
- Cell: 修复 arrow-direction 设置为 right 不显示的问题 [#11279](https://github.com/vant-ui/vant/issues/11279)
- Style: 修复 body 标签上的 normalize 样式未生效的问题 [#11287](https://github.com/vant-ui/vant/issues/11287)
### [v4.0.0-rc.8](https://github.com/vant-ui/vant/compare/v4.0.0-rc.7...v4.0.0-rc.8)
`2022-11-20`
**Feature**
- 新增 BackTop 回到顶部组件,注意该新组件的 API 尚未稳定,在 4.0 正式版发布前仍可能产生 breaking change [#11236](https://github.com/vant-ui/vant/issues/11236)
**Bug Fixes**
- DropdownItem: 修复使用 teleport 时无法设置 attr 的问题 [#11273](https://github.com/vant-ui/vant/issues/11273)
- List: 修复初始的 loading 值为 true 时加载错误的问题 [#11275](https://github.com/vant-ui/vant/issues/11275)
- NumberKeyboard: 修复使用 teleport 时无法设置 attr 的问题 [#11274](https://github.com/vant-ui/vant/issues/11274)
### [v4.0.0-rc.7](https://github.com/vant-ui/vant/compare/v4.0.0-rc.6...v4.0.0-rc.7)
`2022-11-13`
**New Component**
- 新增 SkeletonAvatar、SkeletonTitle、SkeletonImage、SkeletonParagraph 组件 [#11173](https://github.com/vant-ui/vant/issues/11173)
**Feature**
- ImagePreview: 新增 long-press 事件 [#11252](https://github.com/vant-ui/vant/issues/11252)
- Popover: 支持非受控模式 [#11244](https://github.com/vant-ui/vant/issues/11244)
**Bug Fixes**
- ActionSheet: 修复标题为空时取消按钮层级错误的问题 [#11213](https://github.com/vant-ui/vant/issues/11213)
- DatePicker: 在生产环境下不再抛出开发错误提示 [#11248](https://github.com/vant-ui/vant/issues/11248)
- Lazyload: 修复使用 lazy-image 时报错 h is not a function 的问题 [#11229](https://github.com/vant-ui/vant/issues/11229)
- Picker: 修复抛出 confirm 事件时 v-model 未正确更新的问题 [#11194](https://github.com/vant-ui/vant/issues/11194)
- Picker: 修复 column 为空时操作报错的问题 [#11249](https://github.com/vant-ui/vant/issues/11249)
- Uploader: 修复 show-upload 为 false 时 chooseFile 无法调用的问题 [#11218](https://github.com/vant-ui/vant/issues/11218)
### [v4.0.0-rc.6](https://github.com/vant-ui/vant/compare/v4.0.0-rc.5...v4.0.0-rc.6)
`2022-10-23`
**Feature**
- Calendar: subtitle 插槽新增 text 和 date 入参 [#11168](https://github.com/vant-ui/vant/issues/11168)
- Cell: 新增 tag 属性 [#11139](https://github.com/vant-ui/vant/issues/11139)
- ImagePreview: 新增 image 插槽 [#11133](https://github.com/vant-ui/vant/issues/11133)
- Toast: 新增 wordBreak 选项 [#11147](https://github.com/vant-ui/vant/issues/11147)
**Bug Fixes**
- CouponList: 修复 coupon 位置错误的问题 [#11153](https://github.com/vant-ui/vant/issues/11153)
- CouponList: 修复输入框样式错误的问题 [#11155](https://github.com/vant-ui/vant/issues/11155)
- Swipe: 修复在 Popup 内时个别情况下渲染错误的问题 [#11162](https://github.com/vant-ui/vant/issues/11162)
### [v4.0.0-rc.5](https://github.com/vant-ui/vant/compare/v4.0.0-rc.4...v4.0.0-rc.5)
`2022-10-07`
**Feature**
- Field: 支持将 label-position 设置为 top [#11102](https://github.com/vant-ui/vant/issues/11102)
- Loading: 新增 icon 插槽 [#11109](https://github.com/vant-ui/vant/issues/11109)
- NavBar: 新增 clickable 属性 [#11048](https://github.com/vant-ui/vant/issues/11048)
- Stepper: 新增 auto-fixed 属性 [#11071](https://github.com/vant-ui/vant/issues/11071)
**Bug Fixes**
- DatePicker: 修复日期超出 maxDate 时格式化不正确的问题 [#11122](https://github.com/vant-ui/vant/issues/11122)
- Tabs: 修复开启 scrollspy 时个别情况下标题栏滚动位置错误的问题 [#11116](https://github.com/vant-ui/vant/issues/11116)
- Tabs: 修复开启 scrollspy 时 nav-bottom 插槽遮挡内容的问题 [#11115](https://github.com/vant-ui/vant/issues/11115)
### [v4.0.0-rc.4](https://github.com/vant-ui/vant/compare/v4.0.0-rc.3...v4.0.0-rc.4)
`2022-09-25`
**Feature**
- Field: end-validate 事件新增 message 参数 [#11080](https://github.com/vant-ui/vant/issues/11080)
**Bug Fixes**
- Tabs: 修复个别情况下页面滚动位置错误的问题 [#11085](https://github.com/vant-ui/vant/issues/11085)
- Tabs: 修复初始化时菜单横向滚动位置错误的问题 [#11059](https://github.com/vant-ui/vant/issues/11059)
### [v4.0.0-rc.3](https://github.com/vant-ui/vant/compare/v4.0.0-rc.2...v4.0.0-rc.3)
`2022-09-12`
**Feature**
- ConfigProvider: 新增 ConfigProviderThemeVars 类型 [#11034](https://github.com/vant-ui/vant/issues/11034)
- Notify: 新增 z-index 属性 [#11032](https://github.com/vant-ui/vant/issues/11032)
- 移除 `@popperjs/core` 依赖,减少安装体积 1.6MB [#11030](https://github.com/vant-ui/vant/issues/11030)
**Types**
- Toast: 修复缺少全局类型定义的问题 [#11033](https://github.com/vant-ui/vant/issues/11033)
### [v4.0.0-rc.2](https://github.com/vant-ui/vant/compare/v4.0.0-rc.1...v4.0.0-rc.2)
`2022-09-11`
**Breaking Changes**
- 调整了所有 CSS 变量的挂载位置,由 `body` 节点调整回 `:root` 节点,调整后与 Vant v3 版本保持一致,以便于 v3 项目更平滑地升级到 v4 版本。 [#11026](https://github.com/vant-ui/vant/issues/11026)
**Bug Fixes**
- Dialog: 修复过渡动画异常的问题 [#11028](https://github.com/vant-ui/vant/issues/11028)
- Empty: 修复深色模式下亮度过高的问题 [#11027](https://github.com/vant-ui/vant/issues/11027)
### [v4.0.0-rc.1](https://github.com/vant-ui/vant/compare/v4.0.0-rc.0...v4.0.0-rc.1)
`2022-09-10`
**Feature**
- 导出所有组件的 props方便进行二次封装 [#11024](https://github.com/vant-ui/vant/issues/11024)
- Dialog: message-align 属性支持设置为 justify [#11014](https://github.com/vant-ui/vant/issues/11014)
- Image: 新增 block 属性 [#11022](https://github.com/vant-ui/vant/issues/11022)
- Toast: 新增 message 插槽 [#11018](https://github.com/vant-ui/vant/issues/11018)
**Bug Fixes**
- Picker: 修复部分情况下未正确更新选中值的问题 [#11009](https://github.com/vant-ui/vant/issues/11009)
- Locale: 修复读取 i18n 文案时可能获取到 JS 原生方法的问题 [#11010](https://github.com/vant-ui/vant/issues/11010)
### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0) ### [v4.0.0-rc.0](https://github.com/vant-ui/vant/compare/v3.6.2...v4.0.0-rc.0)
`2022-09-04` `2022-09-04`
@ -61,7 +519,7 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
**New Component** **New Component**
- 新增 [Space 间距](#/zh-CN/space) 组件, 由 [@LadyChatterleyLover](https://github.com/LadyChatterleyLover) 贡献 [#10857](https://github.com/vant-ui/vant/issues/10857) - 新增 [Space 间距](#/zh-CN/space) 组件, 由 [@LadyChatterleyLover](https://github.com/LadyChatterleyLover) 贡献 ❤️ [#10857](https://github.com/vant-ui/vant/issues/10857)
**Feature** **Feature**

View File

@ -0,0 +1,138 @@
# Contribution Guide
### Introduction
Thank you for using Vant.
Below are the guidelines for submitting feedback or code to Vant. Please take a few minutes to read the following before submitting an issue or PR to Vant.
### Issue Specification
- If you encountered a problem, please first confirm whether the problem has been recorded in the issue or has been fixed.
- When submitting an issue, please describe the problem you encountered in a short language, and add the environment and reproduction steps when the problem occurs.
## Participate in development
### Local development
Before developing locally, please make sure that [Node.js >= 14.19.0](https://nodejs.org) is installed in your development environment.
Follow the steps below to develop Vant components locally.
```bash
# Clone repository
git clone git@github.com:vant-ui/vant.git
# Enable pnpm package manager
corepack enable
# Install dependencies
pnpm i
# Start development
pnpm dev
```
Different branches of the repository correspond to different Vant versions, please switch to the appropriate branch for development:
- The main branch corresponds to the Vant 4 version, suitable for Vue 3
- 3.x branch corresponds to Vant 3 version, suitable for Vue 3
- 2.x branch corresponds to Vant 2 version, suitable for Vue 2
### Mirror repository
If GitHub cloning is slow, you can also directly clone Vant's [mirror repository](https://gitee.com/vant-contrib/vant) directly on gitee:
```bash
git clone git@gitee.com:vant-contrib/vant.git
```
The mirror repository is only used to speed up local access, please do not submit issues and pull requests to the mirror repository.
### Directory Structure
Vant uses monorepo for code management, and all subpackages are in the `packages/vant` directory:
```
root
└─ packages
├─ vant # Component library
├─ vant-cli # Scaffolding
├─ vant-icons # Icon library
├─ vant-use # Composition API
└─ .... # Other npm packages
```
Among them, the `packages/vant` directory is the core code of the component library:
```
vant
├─ docs # Documentation
├─ src # Component source code
├─ test # Test utils
└─ vant.config.mjs # Document configuration
```
The `packages/vant/src` directory contains the source code of each component, and each folder corresponds to a component:
```
src
└─ button
├─ demo # Demo code
├─ test # Unit test
├─ Component.tsx # Component
├─ index.ts # Component entry
├─ index.less # Styles
├─ README.md # English document
└─ README.zh-CN.md # Chinese document
```
### Code Specification
When writing code, please note:
- Make sure the code can pass the repository's ESLint check.
- Make sure the code format is standardized, use prettier for code formatting.
- Make sure you don't use incompatible APIs like `async`, `await`.
## Submitting a Pull Request
### Reference Guide
If this is your first time submitting a pull request on GitHub, you can learn from the following article:
- [First participation in open source](https://github.com/firstcontributions/first-contributions)
### Pull Request Specification
When submitting a Pull Request, please note:
- Keep your PRs small enough that a PR only addresses a single issue or adds a single feature.
- When adding new components or modifying original components, remember to add or modify the corresponding unit tests to ensure the stability of the code.
- Please include an appropriate description in the PR, and link related issues.
### Pull Request Process
1. Fork the main repository. If you have already forked, please synchronize the latest code from the main repository.
2. Create a new branch based on the main branch of the repository after the fork, such as `feature/button_color`.
3. Develop on the new branch. When development is complete, submit a pull request to the main branch of the main repository.
4. The pull request is merged into the main repository after the review is approved.
5. Wait for Vant to release a new version, usually once a week.
### Synchronize the latest code
Before submitting a Pull Request, please synchronize the latest code of the main repository according to the following process:
```bash
# Add the main repository to remote
git remote add upstream git@github.com:vant-ui/vant.git
# Pull the latest code from the main repository
git fetch upstream
# Switch to the main branch
git checkout main
# Merge the code from the main repository
git merge upstream/main
```

Some files were not shown because too many files have changed in this diff Show More