Compare commits

...

330 Commits
v3.5.1 ... next

Author SHA1 Message Date
chenjiahan
b45b0b7608 chore: update branches in GitHub actions 2022-09-10 21:57:09 +08:00
chenjiahan
c309ca2aaf docs: switch dev branch to v4 2022-09-10 21:53:49 +08:00
chenjiahan
66df033ec8 Merge branch 'dev' into next 2022-09-10 21:51:26 +08:00
neverland
e2ea3be819
feat: export props of all components (#11024) 2022-09-10 21:49:21 +08:00
neverland
019c328975
chore: remove *.less from sideEffects (#11023) 2022-09-10 17:17:23 +08:00
neverland
0e55b72200
feat(Image): add block prop (#11022) 2022-09-10 17:13:14 +08:00
neverland
69d3ba000c
chore: bump pnpm version to 7.11 (#11021) 2022-09-10 12:46:55 +08:00
neverland
9418fe371d
docs: improve use component guide (#11020) 2022-09-10 12:28:43 +08:00
neverland
5d8282ddae
docs(Toast): add component usage guide (#11019) 2022-09-10 11:40:11 +08:00
neverland
43ff890d79
feat(Toast): add message slot (#11018) 2022-09-10 11:32:38 +08:00
neverland
98642589ee
docs: add picker-group to migration guide (#11016) 2022-09-08 23:16:08 +08:00
neverland
6f910c9913
feat(Dialog): message-align can be justify (#11014) 2022-09-07 23:20:28 +08:00
chenjiahan
1b08f84ac6 docs(changelog): @vant/cli 4.0.4 2022-09-06 00:03:50 +08:00
chenjiahan
f0d3e04fba release: @vant/cli 4.0.4 2022-09-06 00:03:00 +08:00
neverland
830a1eb5cf
fix(@vant/cli): failed to build types of sfc (#11012) 2022-09-06 00:00:28 +08:00
Fengyuan Chen
cd439c04f3 fix(utils): avoid getting unexpected value (#11010)
For example, when calling `get({}, 'button.small')`, it expects to return an empty string, but return a function (`''.small` is a native function, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/small).
2022-09-05 23:42:11 +08:00
neverland
0aac165d4e
fix(Picker): failed to update value in some cases (#11009) 2022-09-04 21:00:18 +08:00
chenjiahan
f60a3b840d docs(changelog): vant@4.0.0-rc.0 2022-09-04 14:51:32 +08:00
chenjiahan
997f3e0acd release: 4.0.0-rc.0 2022-09-04 14:49:15 +08:00
chenjiahan
e2fe50250c Merge branch 'dev' into next 2022-09-04 14:34:46 +08:00
neverland
bc024a105c
docs(changelog): vant@3.6.2 (#11008) 2022-09-04 14:31:12 +08:00
chenjiahan
7afb74345a release: 3.6.2 2022-09-04 14:26:50 +08:00
neverland
65fdb2155b
chore: bump all deps (#11007)
* chore: bump all deps

* chore: fix type

* chore: fix withInstall type
2022-09-04 14:24:59 +08:00
neverland
c6bc97f4e4
docs: update quickstart guide (#11006)
* docs: update quickstart guide

* docs: update
2022-09-04 10:01:19 +08:00
chenjiahan
7d023fd6e4 docs: update babel-plugin-import tip 2022-09-04 09:59:42 +08:00
neverland
1afe960f30
feat: add new PickerGroup component (#11005)
* feat: add PickerGroup component

* chore: remove log

* chore: en doc

* chore: add snapshot

* docs: update
2022-09-04 09:39:37 +08:00
neverland
3e039b02b5
docs: add function component style guide (#11003) 2022-09-02 23:24:27 +08:00
Alan Wang
1837ed712f
fix(indexBar): index-bar not positioned correctly when scrolled to the bottom (#10994) 2022-09-02 23:01:22 +08:00
chenjiahan
94c5afe65c release: @vant/area-data 1.3.2 2022-09-01 23:23:23 +08:00
yanbo
5174a1a668
fix(area-data): update counties of Daxinganling region (#11000) 2022-09-01 16:29:17 +08:00
童欧巴
ed8cd77449
docs: fix card overflow issue (#10988)
Co-authored-by: huoyitong <huoyitong@lixiang.com>
2022-08-29 18:44:18 +08:00
neverland
a677bee2b8
fix(DatePicker): min-date prop not work correctly (#10985) 2022-08-28 17:11:04 +08:00
neverland
05544c109f
fix(DatePicker): failed to update model value (#10984) 2022-08-28 16:59:41 +08:00
neverland
21c57caa9b
docs(DatePicker): fix toolbar slot name (#10983) 2022-08-28 11:52:14 +08:00
chenjiahan
66aa2906e0 docs(DatePicker): fix basic usage 2022-08-28 11:01:49 +08:00
chenjiahan
61ef6b9a98 chore(Picker): add getEventParams function 2022-08-28 10:50:49 +08:00
neverland
c25acb8d46
chore(PIcker): split PickerToolbar component (#10982) 2022-08-28 10:43:14 +08:00
chenjiahan
8bcb34724f fix(Picker): fix passive event 2022-08-28 10:01:14 +08:00
chenjiahan
cf5e7e6629 Merge branch 'dev' into next 2022-08-28 09:47:56 +08:00
neverland
a02cfe9604
fix(Swipe): should not prevent touch move when reach edge (#10980) 2022-08-27 15:44:06 +08:00
neverland
71354f7742
fix(@vant/cli): add passive for global touchstart (#10979) 2022-08-27 15:22:56 +08:00
neverland
84b05f0668
docs: prefer using externalVue in nuxt 3 (#10978) 2022-08-27 15:07:43 +08:00
neverland
95542bf06e
docs: add nuxt 3 guide (#10977) 2022-08-27 13:48:59 +08:00
neverland
8d15fa4fdf
fix(Calendar): allow default date to be maxDate when enable allowSameDay (#10976) 2022-08-27 11:29:30 +08:00
chenyunjie
35f81fb208
fix(Calendar): range type defaultDate when set allowSameDay (#10971) 2022-08-27 11:15:46 +08:00
neverland
da3400435f
fix: reduce passive event warning of touchmove event (#10975) 2022-08-27 11:12:36 +08:00
neverland
50ee584953
docs(changelog): vant@4.0.0-beta.1 (#10966) 2022-08-24 22:53:35 +08:00
chenjiahan
889b28609a release: 4.0.0-beta.1 2022-08-24 22:47:17 +08:00
chenjiahan
6a7376d15d docs(changelog): 3.6.1 2022-08-24 22:43:13 +08:00
chenjiahan
2cca630808 release: 3.6.1 2022-08-24 22:40:20 +08:00
neverland
dcffa09812
feat(Popup): improve style when position is center (#10965) 2022-08-24 22:40:11 +08:00
chenjiahan
0881de82af docs(ImagePreview): fix cell style in demo 2022-08-24 22:19:13 +08:00
chenjiahan
86adc66dd9 Restore "fix(Popup&Toast): invalid adaptive width (#10961)"
This reverts commit aa1689fed8e58d52db2367263ccbcc08853ff848.
2022-08-24 22:04:46 +08:00
chenjiahan
1d87343195 Merge branch 'dev' into next 2022-08-24 22:04:34 +08:00
chenjiahan
aa1689fed8 Revert "fix(Popup&Toast): invalid adaptive width (#10961)"
This reverts commit b6dd0cb36c0445e199335c36a4c21e696cf8b073.
2022-08-24 21:56:10 +08:00
yinhaogt
b6dd0cb36c
fix(Popup&Toast): invalid adaptive width (#10961)
* fix(Popup&Toast):Invalid adaptive width

* Update index.less

Co-authored-by: neverland <jait.chen@foxmail.com>
2022-08-24 21:45:10 +08:00
neverland
4b2e06b34d
fix(Tabs): resize not work for swipeable tabs (#10964) 2022-08-24 21:32:29 +08:00
neverland
717f244d2f
fix: reduce passive event warning of touchstart event (#10954) 2022-08-21 22:08:27 +08:00
neverland
6b7ae0f6a0
types(@vant/use): improve useEventListener typing (#10952) 2022-08-21 17:49:48 +08:00
neverland
cb93bd2da3
perf: add correct passive flag to improve scroll performance (#10951) 2022-08-21 17:33:57 +08:00
neverland
ca583e1075
docs(NoticeBar): disable swipe drag in demo (#10950) 2022-08-21 17:28:32 +08:00
chenjiahan
667034322e docs(changelog): vant@3.6.0 2022-08-21 11:30:21 +08:00
chenjiahan
8d51f9e08e release: 3.6.0 2022-08-21 11:23:01 +08:00
neverland
236a2e43f3
fix(Popover): can not scroll inside popup (#10949)
* fix(Popover): can not scroll inside popup

* fix: ref
2022-08-21 11:18:20 +08:00
chenjiahan
326880a4e1 release: @vant/use 1.4.2 2022-08-21 10:56:57 +08:00
neverland
31ac5faa3a
feat(@vant/use): useClickAway support multiple targets (#10948) 2022-08-21 10:55:18 +08:00
neverland
1e8187bc37
chore: fix failed to deploy website (#10947) 2022-08-21 10:06:45 +08:00
neverland
72d515b30e
fix: incorrect tag name in WebStorm (#10946) 2022-08-21 10:03:05 +08:00
neverland
b4072ef2bd
docs: import quick start document (#10945) 2022-08-21 09:52:09 +08:00
neverland
ec1d32db4a
fix(Empty): generate unique id to avoid render issue (#10943) 2022-08-20 22:51:08 +08:00
neverland
dfdc27a755
docs: add faq of remove babel-plugin-import (#10942)
* docs: add faq of remove babel-plugin-import

* docs: update
2022-08-20 22:35:12 +08:00
neverland
8574339579
docs: add import tips (#10941) 2022-08-20 22:28:05 +08:00
neverland
5c6992f97c
feat(ConfigProvider): add theme-vars-dark and theme-vars-light props (#10939) 2022-08-19 23:10:41 +08:00
chenjiahan
292ac6b55e Merge branch 'dev' into next 2022-08-19 22:14:47 +08:00
neverland
1945c35b17
fix(PullRefresh): remove passive event warning (#10938) 2022-08-19 22:04:52 +08:00
Yanghc
da3ad139d4
docs(Search): fix action-text type (#10936) 2022-08-19 17:35:45 +08:00
Yanghc
3aca130ca5
docs(Search): fix action-text type (#10935) 2022-08-19 17:35:26 +08:00
小镇靓仔
f060d1a813
docs: add tips in advanced-usage.zh-CN.md (#10927)
* docs: add tips in advanced-usage.zh-CN.md

* Update advanced-usage.zh-CN.md

Co-authored-by: neverland <jait.chen@foxmail.com>
2022-08-18 15:01:45 +08:00
zhangenming
041039b5e9
feat(Badge): fix the problem mentioned at README. (#10921)
* Update Badge.tsx

* Update README.zh-CN.md

* Update README.zh-CN.md

Co-authored-by: neverland <jait.chen@foxmail.com>
Co-authored-by: neverland <chenjiahan@youzan.com>
2022-08-17 11:51:35 +08:00
neverland
68b93a4008
chore: fix CI not work for pull request (#10923) 2022-08-17 11:48:19 +08:00
neverland
4e83e5ecc0
feat(ConfigProvider): add z-index prop (#10915) 2022-08-16 22:09:48 +08:00
limingxin
8ef197ea12
docs: fix link address in migrate-from-v3.md (#10919) 2022-08-16 16:09:35 +08:00
neverland
dc0a29be17
feat(Form): add validateEmpty option of rule (#10913) 2022-08-14 11:03:49 +08:00
neverland
a06f1567db
docs(Form): fix the type of rule trigger option (#10912)
* docs(Form): fix the type of rule trigger option

* docs: update
2022-08-14 09:53:38 +08:00
neverland
e17cc35dcf
fix(Search): --van-search-input-height var not work (#10911)
* fix(Search): --van-search-input-height var not work

* chore: update padding
2022-08-14 09:44:52 +08:00
neverland
04494a450d
fix(Calendar): content disappeared when hiding (#10910)
* fix(Calendar): content disappeared when hiding

* chore: add comment

* chore: upd
2022-08-13 13:24:12 +08:00
neverland
e5cc32ca97
fix(Calendar): reading getFullYear error in some cases (#10909) 2022-08-13 12:03:07 +08:00
neverland
c3776877ca
fix(Calendar): fix reading getFullYear error (#10908) 2022-08-13 11:43:15 +08:00
neverland
f61b00175e
fix(ConfigProvider): should remove theme class on unmount (#10898) 2022-08-10 08:31:46 +08:00
chenjiahan
6a1516ca37 Merge branch 'dev' into next 2022-08-10 07:58:38 +08:00
chenjiahan
7eaefd04fa test(Popup): fix snapshot 2022-08-09 10:08:23 +08:00
richex-cn
ed5ea225ca
feat(Popup): add role and tabindex for a11y (#10894)
* feat(Popup): add role and tabindex for a11y

* Update Popup.tsx

Co-authored-by: neverland <jait.chen@foxmail.com>
2022-08-09 10:04:13 +08:00
neverland
b117e21dc4
feat(touch-emulator): support .mjs extension (#10888) 2022-08-06 22:53:57 +08:00
chenjiahan
961f70d523 docs(changelog): 3.5.4 2022-08-06 20:13:04 +08:00
chenjiahan
cfdb5c1fbe release: 3.5.4 2022-08-06 20:12:56 +08:00
neverland
89718934af
fix(@vant/cli): should replace NODE_ENV in vite v3 (#10887) 2022-08-06 17:37:16 +08:00
neverland
6fee5cfed8
docs(Space): add version tip (#10886) 2022-08-06 17:34:30 +08:00
neverland
9e8a0864c3
chore(Space): improve demo and document (#10870) 2022-07-31 20:09:13 +08:00
luopei
c3a8275ebf
feat(Space): add new component space (#10857)
* feat(Space): add new component space

* feat(Space): improve functions,documents and add test
2022-07-31 18:20:16 +08:00
neverland
c88b034aac
docs(changelog): vant@3.5.3 (#10869) 2022-07-31 09:43:21 +08:00
chenjiahan
d96c4228f5 release: 3.5.3 2022-07-31 09:37:10 +08:00
neverland
41d6b5191d
docs: update readme (#10868) 2022-07-30 21:43:56 +08:00
neverland
d3c679aa27
docs: add babel-plugin-import migration guide (#10867) 2022-07-30 20:22:43 +08:00
neverland
e6b43db90b
refactor(@vant/cli): remove vetur configs (#10866) 2022-07-30 19:55:17 +08:00
neverland
2f6ef7aed8
feat(Picker): add clickOption event (#10865)
* feat(Picker): add clickOption event

* chore: update
2022-07-30 14:04:43 +08:00
Yorksh1re
729e283ab5
fix(docs): fix button example type in documentation (#10850)
* fix(docs): fix buttons type

* Update README.md

Co-authored-by: neverland <chenjiahan.jait@bytedance.com>
2022-07-26 10:22:52 +08:00
neverland
a1d4297c92
chore(Collapse): fix snapshot and update document (#10845) 2022-07-24 18:13:47 +08:00
luopei
e45ac25ac0
feat(Collapse): collapse add toggleAll method for issues #10818 (#10837)
* feat(Collapse): collapse add toggleAll method for issues #10818

* docs: fix some problems

Co-authored-by: 骆沛 <luopei@11.com>
2022-07-24 17:21:09 +08:00
chenjiahan
83a4e286bd Merge branch 'dev' into next 2022-07-23 22:20:49 +08:00
chenjiahan
f4ab1b8c0c chore: fix missing deps 2022-07-23 22:13:26 +08:00
chenjiahan
7879fd6395 chore: update repo links 2022-07-23 22:10:20 +08:00
neverland
11dbde14f6
chore(@vant/cli): no longer provide stylelint (#10844) 2022-07-23 21:41:38 +08:00
neverland
537e629d7d
chore: update baidu analytics seed (#10843) 2022-07-23 21:23:50 +08:00
chenjiahan
178df39c44 Merge branch 'dev' into next 2022-07-23 21:20:27 +08:00
neverland
74c1c2927e
feat(@vant/cli): bump vite 3.0 (#10842)
* feat(@vant/cli): bump vite 3.0

* chore: bump vite plugins
2022-07-23 18:59:57 +08:00
neverland
a31f78b07a
docs: improve description of name and required props (#10841)
* docs: improve description of name and required props

* docs: fix
2022-07-23 18:36:00 +08:00
neverland
794fd029a0
fix(Popover): allow to dynamically set offset prop (#10840) 2022-07-23 18:26:15 +08:00
chenjiahan
c628a66770 release: create-vant-cli-app 2.0.1 2022-07-23 18:14:28 +08:00
neverland
b6c8d3f39f
fix(create-vant-cli-app): missing demo registration (#10839) 2022-07-23 18:11:48 +08:00
dyh333
627661e0ed
docs(Icon): separate usingUrl demo from basicUsage (#10828)
Co-authored-by: dingyihui <dingyihui@cmss.chinamobile.com>
2022-07-20 21:36:08 +08:00
neverland
11d25a0b0e
fix: failed to get correct height of safe area element (#10827)
* fix: failed to get correct height of safe area element

* docs: upd
2022-07-17 15:10:35 +08:00
neverland
b46b429682
docs(changelog): 4.0.0-beta.0 (#10825) 2022-07-16 15:07:38 +08:00
chenjiahan
15142770f2 release: 4.0.0-beta.0 2022-07-16 15:00:14 +08:00
chenjiahan
aea97f90e6 Merge branch 'dev' into next 2022-07-16 14:58:24 +08:00
chenjiahan
abce9fdafd chore: downgrade lock file version 2022-07-16 14:57:33 +08:00
Sepush
1050ab33f5
chore: peer dependencies (#10811)
Signed-off-by: Sepush <sepush@outlook.com>
2022-07-16 14:56:27 +08:00
chenjiahan
a0bd47dd84 Merge branch 'dev' into next 2022-07-10 21:23:47 +08:00
neverland
1ac1bb94e7
feat(cli): support site.headHtml option (#10807)
* feat(cli): support site.headHtml option

* docs: update

* docs: update
2022-07-10 21:20:32 +08:00
chenjiahan
53162941da chore: update lock file 2022-07-09 20:55:30 +08:00
neverland
e998c1be95
feat: add @vant/compat package (#10806)
* feat: add @vant/compat package

* chore: remove prepare script
2022-07-09 20:54:27 +08:00
汪東陽
a53dc02b0a
chore: add typescript dev deps to vant-markdown-vetur (#10805) 2022-07-09 18:10:50 +08:00
neverland
1ce400bb7f
refactor(Toast): redesign function-call API (#10804) 2022-07-09 17:09:54 +08:00
neverland
5a3fe7ed0f
chore: rename unreleased API (#10803) 2022-07-09 15:38:28 +08:00
neverland
1bc6cbdb69
refactor(ImagePreview): redesign function-call API (#10802) 2022-07-09 15:32:02 +08:00
neverland
5179891faa
chore(cli): using npx to run gh-pages (#10799) 2022-07-07 22:41:44 +08:00
neverland
ba95cad78d
docs: update website domain (#10798) 2022-07-07 22:27:48 +08:00
活轨
9a6bc32cf4
fix(Uploader): should not preview failed images (#10790)
Co-authored-by: Rail <wanglifei@yiqicai.com>
2022-07-07 21:46:38 +08:00
Alan Wang
419a8e4f0e
feat(Calendar): expose getSelectedDate method 2022-07-04 20:34:20 +08:00
neverland
d712da5778
chore(cli): remove custom font (#10784) 2022-07-03 13:58:38 +08:00
neverland
5f526c9f0e
chore(Dialog): rename unreleased API (#10783) 2022-07-03 13:54:06 +08:00
neverland
ec78d5b1d9
refactor(Notify): redesign function-call API (#10782)
* refactor(Notify): redesign function-call API

* docs: update
2022-07-03 13:39:27 +08:00
neverland
e5e6e8aaa4
refactor(Dialog): redesign function-call API (#10781)
* refactor(Dialog): re-design function-call API

* chore: remove invalid char

* docs: order

* chore: remove var
2022-07-03 12:28:25 +08:00
chenjiahan
e27efdad0d Merge branch 'dev' into next 2022-07-03 10:57:43 +08:00
neverland
beeb059401
perf(cli): improve cli boot time (#10780)
* chore: test

* perf(cli): improve cli boot time
2022-07-03 10:53:14 +08:00
neverland
5883d3e0c7
perf(cli): replace ora with nanospinner (#10779) 2022-07-02 23:05:11 +08:00
neverland
2e27c67c76
perf(cli): replace lint-staged with nano-staged (#10778) 2022-07-02 22:57:41 +08:00
neverland
28e8b72ccd
chore(cli): replace chalk with picocolors (#10777) 2022-07-02 22:51:53 +08:00
neverland
8256fdc927
chore: bump eslint-plugin-vue v9 (#10776)
* chore: bump eslint-plugin-vue v9

* chore: release @vant/eslint-config@3.5.0
2022-07-02 22:46:24 +08:00
neverland
e60f36390a
chore: bump @vue/test-utils to v2 stable (#10775) 2022-07-02 22:40:41 +08:00
neverland
0a8420fdac
chore: bump typescript v4.7 (#10774) 2022-07-02 22:35:45 +08:00
neverland
eea5f002a7
chore(cli): bump release-it v15 (#10773) 2022-07-02 22:26:41 +08:00
neverland
2f1066e9c6
docs(changelog): @vant/cli@4.0.3 (#10772) 2022-07-02 22:16:48 +08:00
chenjiahan
e4fc6f9081 release: @vant/cli 4.0.3 2022-07-02 22:09:45 +08:00
Alanscut
cb751211f1 fix(@vant-cli): compilation error when using setup syntactic sugar and including subcomponents 2022-07-02 22:06:52 +08:00
chenjiahan
e5a3aa103d docs(changelog): vant@3.5.2 2022-06-26 22:29:34 +08:00
chenjiahan
52957ec244 release: 3.5.2 2022-06-26 22:27:22 +08:00
chenjiahan
a49fa3648f chore: license in monorepo root 2022-06-26 22:22:21 +08:00
chenjiahan
cc698f561e chore: add license to sub-packages 2022-06-26 22:22:21 +08:00
neverland
f46c9c6548
chore: improve license of forked code (#10753) 2022-06-26 21:58:13 +08:00
neverland
154408fa8b
perf: remove less source file to remove bundle size (#10752)
* perf: remove css source file to remove bundle size

* docs: update migration guide
2022-06-26 21:52:40 +08:00
chenjiahan
20ee462cab Merge branch 'dev' into next 2022-06-26 21:43:49 +08:00
neverland
293dab6a51
feat(cli): add build.bundleOptions config (#10751) 2022-06-26 21:42:28 +08:00
neverland
bb23e1b700
feat(cli): add css.removeSourceFile config (#10750) 2022-06-26 17:15:11 +08:00
chenjiahan
2b77f96fc5 Merge branch 'dev' into next 2022-06-25 12:48:53 +08:00
AmazingPromise
e61d85a890 fix(List): element with overflow: overlay style should be considered a scroll container (#10743) 2022-06-25 12:36:27 +08:00
neverland
2c2cdd077f
chore(cli): remove unused ssr.js (#10729) 2022-06-19 16:04:10 +08:00
neverland
c83a57b2bd
docs: add guide of function component style (#10728) 2022-06-19 15:34:00 +08:00
chenjiahan
1d5cb1e051 Merge branch 'dev' into next 2022-06-18 20:34:49 +08:00
neverland
6f94627bf4
feat(Field): add start-validate and end-validate event (#10726) 2022-06-18 20:31:16 +08:00
neverland
7ca4db9c64
feat(SubmitBar): add placeholder prop (#10725) 2022-06-18 18:38:23 +08:00
neverland
a1c79f42ff
feat(ActionBar): add placeholder prop (#10724) 2022-06-18 18:26:08 +08:00
neverland
6225c8123c
docs(Switch): fix custom node demo (#10720) 2022-06-16 18:45:27 +08:00
chenjiahan
ffefe3002f docs(changelog): 3.5.1 2022-06-12 12:49:53 +08:00
chenjiahan
5d81dcb549 Merge branch 'dev' into next 2022-06-11 20:23:35 +08:00
chenjiahan
63519433f1 docs(changelog): 4.0.0-alpha.4 2022-05-31 20:12:05 +08:00
chenjiahan
1f19fb0d9f release: 4.0.0-alpha.4 2022-05-31 20:09:47 +08:00
chenjiahan
f13601cb9f Merge branch 'dev' into next 2022-05-31 20:05:10 +08:00
neverland
5cd731594f
feat: using mjs extension for esmodule (#10625) 2022-05-22 20:10:14 +08:00
chenjiahan
582582e480 Merge branch 'dev' into next 2022-05-22 19:59:35 +08:00
chenjiahan
fe2115ee5c docs(changelog): 4.0.0-alpha.3 2022-05-02 11:09:34 +08:00
chenjiahan
bc60f5116b release: 4.0.0-alpha.3 2022-05-02 11:07:49 +08:00
chenjiahan
b65396ef06 Merge branch 'dev' into next 2022-05-02 11:03:12 +08:00
Alan Wang
523d9ef400
fix(Search): style error in dark mode (#10527) 2022-04-23 09:58:09 +08:00
chenjiahan
912a5f17b1 docs(changelog): 4.0.0-alpha.2 2022-04-16 22:09:58 +08:00
chenjiahan
ea57c9e9ff release: 4.0.0-alpha.2 2022-04-16 22:08:38 +08:00
chenjiahan
ac7d6dd542 Merge branch 'dev' into next 2022-04-16 21:59:33 +08:00
chenjiahan
a0389defcc Merge branch 'dev' into next 2022-04-05 10:31:21 +08:00
chenjiahan
26cbffe6c1 chore: fix some Numeric type 2022-03-27 18:13:09 +08:00
chenjiahan
a541090f3a Merge branch 'dev' into next 2022-03-27 18:12:42 +08:00
chenjiahan
e08e9845a2 breaking change(AddressEdit): remove postal 2022-03-26 20:12:24 +08:00
chenjiahan
8e822a591d Merge branch 'dev' into next 2022-03-26 19:10:50 +08:00
chenjiahan
8e78b6d8ad Merge branch 'dev' into next 2022-03-23 09:11:13 +08:00
chenjiahan
5bff9e8c5f docs(changelog): 4.0.0-alpha.1 2022-03-19 20:08:46 +08:00
chenjiahan
475d108ccb release: 4.0.0-alpha.1 2022-03-19 20:06:05 +08:00
chenjiahan
527bad9cc2 Merge branch 'dev' into next 2022-03-19 20:04:31 +08:00
neverland
47a5151a20
docs(Picker): add v-model usage (#10417) 2022-03-19 20:02:56 +08:00
neverland
dd724fde4d
docs(DatePicker): fix formatter usage (#10416) 2022-03-19 19:51:03 +08:00
neverland
a584cc217b
fix(DatePicker): failed to update model value (#10415) 2022-03-19 19:48:28 +08:00
neverland
5b72c4005b
test: fix snapshots of cell (#10414) 2022-03-19 19:44:45 +08:00
neverland
d2f6a3c96f
fix(ConfigProvider): dark mode not work as default value (#10413) 2022-03-19 19:42:28 +08:00
TeRny
239be20cbf
fix(Calendar, Picker): Fix calendar and picker's title color in dark mode (#10403)
* 解决Dialog组件的标题、消息内容在深色模式下仍显示黑色的问题

* 解决Picker和Calendar组件的Title在深色模式下为黑色的问题

Co-authored-by: 朱坤 <zhukun.gz@chinatelecom.cn>
2022-03-17 20:34:45 +08:00
chenjiahan
101dcc3ef2 Merge branch 'dev' into next 2022-03-13 16:27:20 +08:00
TeRny
8572393881
fix(Dialog): Fix dialog title and message color in dark mode (#10379)
Co-authored-by: 朱坤 <zhukun.gz@chinatelecom.cn>
2022-03-11 14:56:39 +08:00
neverland
0d79eb244b
docs: update 4.0.0-alpha changelog (#10339) 2022-02-27 20:57:46 +08:00
chenjiahan
db2e6ca12f docs: fix publicPath 2022-02-21 13:39:21 +08:00
chenjiahan
992eea3eeb build: fix workflow name 2022-02-21 12:27:25 +08:00
chenjiahan
3a1e792e31 docs: update 2022-02-21 12:26:31 +08:00
chenjiahan
06199faf2c build: deploy v4 site 2022-02-21 12:22:46 +08:00
chenjiahan
c206642d2d release: 4.0.0-alpha.0 2022-02-21 12:13:17 +08:00
chenjiahan
5bade79394 chore: add npm tag 2022-02-21 12:11:18 +08:00
chenjiahan
2ceb68e691 docs: update Vant 4 2022-02-20 21:02:09 +08:00
chenjiahan
9cfef027aa docs(Form): fix Picker demo 2022-02-20 20:54:16 +08:00
chenjiahan
0b4b04eefb chore: fix Cell usage 2022-02-20 20:48:20 +08:00
chenjiahan
0a7b535533 style(Cell): remove value aline style 2022-02-20 20:47:01 +08:00
chenjiahan
17c2022a6f chore(AddressEdit): avoid using innerHTML 2022-02-20 20:36:04 +08:00
chenjiahan
cce3ceb5b6 style(TreeSelect): using primary color 2022-02-20 20:24:11 +08:00
chenjiahan
fcd91cb0b0 style(AddressList): using primary color 2022-02-20 20:22:49 +08:00
chenjiahan
3692014070 style(Card): blue tag 2022-02-20 20:19:27 +08:00
chenjiahan
85c5ad6718 style(CouponList): change default color 2022-02-20 20:17:05 +08:00
chenjiahan
bef919c7f0 style: increase font-weight bold 2022-02-20 10:04:39 +08:00
chenjiahan
d39f6a898a style(ContactList): using primary color 2022-02-18 14:22:25 +08:00
chenjiahan
43ae30026a style(ContactEdit): adjust submit button 2022-02-18 14:11:54 +08:00
chenjiahan
27c46b01ae types(AddressEdit): SearchItem optional 2022-02-18 11:36:55 +08:00
chenjiahan
3979ddc40a fix(AddressEdit): selectedOption maybe undefined 2022-02-17 16:35:07 +08:00
chenjiahan
967cb56c18 types(Picker): fix return type of getSelectedOptions 2022-02-17 16:25:53 +08:00
chenjiahan
c65d4f9672 style(AddressEdit): submit button using primary type 2022-02-17 16:16:55 +08:00
chenjiahan
73788f9e88 style(Switch): adjust width 2022-02-17 15:36:23 +08:00
chenjiahan
2acd47b5ee style(Switch): adjust style 2022-02-17 15:31:52 +08:00
chenjiahan
b3cf1dfb54 breaking change(AddressEdit): adjust change-area event params 2022-02-16 12:14:01 +08:00
chenjiahan
35a50012c7 feat(Area): add getSelectedOptions method 2022-02-16 12:02:46 +08:00
chenjiahan
83295e655d feat(Picker): add getSelectedOptions method 2022-02-16 12:00:32 +08:00
chenjiahan
e2790fe95d chore(DatePicker): reuse genOptions 2022-02-16 11:06:58 +08:00
chenjiahan
b608fb23f0 types(TimePicker): export TimePickerColumnType 2022-02-16 10:59:31 +08:00
chenjiahan
829db06d5b types(DatePicker): export DatePickerColumnType 2022-02-16 10:59:20 +08:00
chenjiahan
2e053ad76b feat(TimePicker): support select second 2022-02-16 10:57:09 +08:00
chenjiahan
c942efb76b docs(DatePicker): fix currentDate of year-month 2022-02-16 10:56:46 +08:00
chenjiahan
fdcf9931be refactor(TimePicker): modelValue now is string array 2022-02-15 17:44:53 +08:00
chenjiahan
e61bd487fa fix(Picker): should update modelValue immediately 2022-02-15 17:36:49 +08:00
chenjiahan
7deba88b91 docs(Form): fix demo 2022-02-15 16:08:31 +08:00
chenjiahan
980f976011 fix(DatePicker): allow modelValue to be empty 2022-02-15 15:55:09 +08:00
chenjiahan
c00fa4cd70 chore: remove legacy DatetimePicker 2022-02-15 15:54:24 +08:00
chenjiahan
ef8e66a924 refactor(DatePicker): v-model now is string array 2022-02-15 15:42:23 +08:00
chenjiahan
e8ffc80dc6 feat(DatePicker): date columns calculation 2022-02-15 15:08:59 +08:00
chenjiahan
3920ebe25b Merge branch 'dev' into next 2022-02-14 11:03:20 +08:00
chenjiahan
5b407566db refactor: DatePicker Component 2022-02-14 10:55:10 +08:00
chenjiahan
f327d5bbc2 test(TimePicker): migrate test cases 2022-02-10 19:48:18 +08:00
chenjiahan
2a8bb86fbb fix(Picker): should update selectedValues correctly 2022-02-10 19:41:19 +08:00
chenjiahan
7dae50b0c9 fix(TimePicker): should update modelValue immediately 2022-02-10 17:56:51 +08:00
chenjiahan
d68053ea7f docs: update migration guide 2022-02-10 16:50:20 +08:00
chenjiahan
8ca9741845 breaking change: event name become camelCase 2022-02-10 16:49:45 +08:00
chenjiahan
c9c312c4ba test: update all snapshots 2022-02-10 16:22:18 +08:00
chenjiahan
5dca6fe2e2 chore: remove unused snapshot 2022-02-10 16:20:34 +08:00
chenjiahan
fdc5436249 test(TimePicker): demo snapshot 2022-02-10 16:19:31 +08:00
chenjiahan
7d22cc2155 fix(TimePicker): remove columns-order prop 2022-02-10 15:57:57 +08:00
chenjiahan
42d1dd836c refactor: TimePicker component 2022-02-10 15:12:21 +08:00
chenjiahan
15e7461a93 docs: docsearch version v4 2022-02-09 16:35:58 +08:00
chenjiahan
0fdaf133bb Merge branch 'dev' into next 2022-02-09 16:31:47 +08:00
chenjiahan
d4584aafda docs: dark mode 2022-02-09 16:31:07 +08:00
chenjiahan
5b3c4f1546 style: update van doc background 2022-02-09 11:34:25 +08:00
chenjiahan
25302fb333 Merge branch 'dev' into next 2022-02-09 11:20:28 +08:00
chenjiahan
2f02f19cec Merge branch 'dev' into next 2022-02-08 14:56:38 +08:00
chenjiahan
82e0e454d0 style(CouponList): update field background color in dark mode 2022-01-28 10:15:46 +08:00
chenjiahan
650bdd2294 feat(ActionBar): update icon text color 2022-01-28 10:15:08 +08:00
chenjiahan
cb2d99c8cf style(Card): improve card mode style 2022-01-28 10:14:45 +08:00
chenjiahan
42f03fe1a2 style(GridItem): adust text color 2022-01-28 10:04:01 +08:00
chenjiahan
fc2847fdb4 style(Slider): improve dark mode color 2022-01-27 19:44:00 +08:00
chenjiahan
d6e80e8954 style(IndexBar): increase font weight of active index 2022-01-27 11:21:00 +08:00
chenjiahan
39b51d5dae style(Tabbar): adjust text color 2022-01-27 11:19:32 +08:00
chenjiahan
8e98e97449 style(Field): adjust label color 2022-01-27 11:07:02 +08:00
chenjiahan
f5c32c29f1 style(@vant/cli): improve mobile style in dark mode 2022-01-27 11:00:38 +08:00
chenjiahan
98b999d911 refactor: rename --van-background-light to --van-background-2 2022-01-27 10:35:57 +08:00
chenjiahan
0e8e3200a2 style(@vant/cli): improve demo style in dark mode 2022-01-26 17:05:47 +08:00
chenjiahan
73322fd310 feat: add dark mode basic variables 2022-01-26 16:00:16 +08:00
chenjiahan
97b074ad0c feat(ConfigProvider): dark theme class 2022-01-26 15:59:52 +08:00
chenjiahan
541458c41b refactor: attach css variables to body element 2022-01-26 15:58:48 +08:00
chenjiahan
df24a3b683 feat(@vant/cli): mobile site support dark mode 2022-01-26 15:57:28 +08:00
chenjiahan
966af9dd68 Merge branch 'dev' into next 2022-01-26 14:12:40 +08:00
chenjiahan
b6fcd32dcf style(@vant/cli): adjust css vars 2022-01-26 10:26:15 +08:00
chenjiahan
35a990ed65 feat(@vant/cli): desktop site support dark mode 2022-01-25 20:03:05 +08:00
chenjiahan
f9573402a7 feat(ConfigProvider): add theme prop 2022-01-25 15:38:57 +08:00
chenjiahan
437dcc6c41 Merge branch 'dev' into next 2022-01-25 14:42:56 +08:00
chenjiahan
5a15660c77 style(Steps): update default button border color 2022-01-24 16:58:56 +08:00
chenjiahan
0706d464b6 test(Area): update all test cases 2022-01-24 16:43:57 +08:00
chenjiahan
8d49b88748 fix(Area): allow to reset modelValue 2022-01-24 16:43:40 +08:00
chenjiahan
5900affe37 test(Picker): update cascade test cases 2022-01-24 16:09:08 +08:00
chenjiahan
bda3617d14 style(Button): adjust font-smoothing 2022-01-24 15:54:32 +08:00
chenjiahan
bd24288a12 style(Button): update default button border color 2022-01-24 15:37:49 +08:00
chenjiahan
3b10d66bb9 style(Tabs): using primary color by default 2022-01-24 15:19:46 +08:00
chenjiahan
41b1cd7185 style(Stepper): using primary color by default 2022-01-24 15:19:25 +08:00
chenjiahan
eeb233bf99 style(Sidebar): using primary color by default 2022-01-24 15:18:28 +08:00
chenjiahan
8b95db1574 style(IndexBar): using primary color by default 2022-01-24 15:17:50 +08:00
chenjiahan
37e7c618b8 style(DropdownMenu): using primary color by default 2022-01-24 15:17:33 +08:00
chenjiahan
84b90b1f4c style(Cascader): using primary color by default 2022-01-24 15:16:58 +08:00
chenjiahan
4e89e88845 style(Calendar): using primary color by default 2022-01-24 15:15:02 +08:00
chenjiahan
d867710cc9 style(Button): increase default border radius from 2px to 4px 2022-01-23 21:39:04 +08:00
chenjiahan
526f54595d chore: fix van-background-light var in demos 2022-01-21 17:19:21 +08:00
chenjiahan
3c3f58a7be Merge branch 'next' of github.com:youzan/vant into next 2022-01-21 16:52:51 +08:00
chenjiahan
e4ab2156f1 test(Picker): update basic test cases 2022-01-21 16:52:32 +08:00
chenjiahan
6bba2906bc chore(Area): adjust some codes 2022-01-21 16:52:32 +08:00
chenjiahan
95cf27745b chore: remove empty area.ts 2022-01-21 16:52:32 +08:00
chenjiahan
a9baa3b2d1 docs(Area): update documents 2022-01-21 16:52:32 +08:00
chenjiahan
0186219586 fix(Picker): error when options is empty 2022-01-21 16:52:32 +08:00
chenjiahan
cca428aac6 refactor: Area component 2022-01-21 16:52:32 +08:00
chenjiahan
113e1b7a62 fix(Picker): currentColumns calculation 2022-01-21 16:52:32 +08:00
chenjiahan
ff69fdacc7 fix(Picker): failed to update modelValue 2022-01-21 16:52:32 +08:00
chenjiahan
6c64bc33c1 types(Picker): fix columns prop typing 2022-01-21 16:52:32 +08:00
chenjiahan
fda3f1be94 docs(@vant/cli): changelog 4.0.0-rc.6 2022-01-21 16:52:32 +08:00
chenjiahan
e93ae7b430 release: @vant/cli 4.0.0-rc.6 2022-01-21 16:52:32 +08:00
zoy-l
4ee1a3d766 fix(vant-cli): pnpm compatibility (#10214)
* fix(vant-cli): pnpm compatibility

* chore: clean code, semantic naming
2022-01-21 16:52:32 +08:00
chenjiahan
cc10eb1f2a docs(Picker): new document 2022-01-21 16:52:32 +08:00
chenjiahan
d16075f39e fix(Picker): option.className not work 2022-01-21 16:52:32 +08:00
chenjiahan
f436b5ae09 docs: update migration guide 2022-01-21 16:52:32 +08:00
chenjiahan
ceaab349f1 docs(Picker): update demo 2022-01-21 16:52:32 +08:00
chenjiahan
22654bf518 fix(Picker): fix some bugs 2022-01-21 16:52:32 +08:00
chenjiahan
c061412138 refactor(Picker): rename item-height to option-height 2022-01-21 16:52:32 +08:00
chenjiahan
89b029aa42 refactor(Picker): data driven 2022-01-21 16:52:32 +08:00
chenjiahan
2c7bafe3c1 Merge branch 'dev' into next 2022-01-19 15:54:57 +08:00
chenjiahan
bcb7eabff3 Merge branch 'dev' into next 2022-01-17 19:48:33 +08:00
chenjiahan
e63f471c77 Merge branch 'dev' into next 2021-12-11 10:41:38 +08:00
chenjiahan
1fc72c68dd Merge branch 'dev' into next 2021-11-19 11:00:11 +08:00
chenjiahan
1bd2ab00ac Merge branch 'dev' into next 2021-11-15 10:59:04 +08:00
chenjiahan
e713e8eade Merge branch 'dev' into next 2021-11-10 15:31:33 +08:00
chenjiahan
26fa234026 Merge branch 'dev' into next 2021-11-04 20:21:28 +08:00
chenjiahan
6c24fa728e docs: update v4 migration guide 2021-11-04 17:48:37 +08:00
chenjiahan
0fedd1dbea Merge branch 'dev' into next 2021-11-04 11:26:29 +08:00
chenjiahan
722f73dfbe Merge branch 'dev' into next 2021-11-03 17:47:44 +08:00
chenjiahan
7d6916b946 breaking change: shorter css var names 2021-11-03 17:36:17 +08:00
chenjiahan
ada5db011c breaking change: no longer support less vars 2021-11-03 16:45:49 +08:00
chenjiahan
099141f6c5 breaking change(Tabs): remove click、disabled event 2021-11-03 16:05:37 +08:00
chenjiahan
6a4033b6bc breaking change(Picker): remove default slot、value-key prop 2021-11-03 16:03:15 +08:00
859 changed files with 23166 additions and 21480 deletions

View File

@ -2,4 +2,4 @@
请移步 GitHub issues 进行反馈: 请移步 GitHub issues 进行反馈:
https://github.com/youzan/vant/issues https://github.com/vant-ui/vant/issues

View File

@ -29,7 +29,7 @@ It's welcomed to pull request, And there are some tips about that:
You will need [Node.js >= 14](https://nodejs.org) and [pnpm](https://pnpm.io). You will need [Node.js >= 14](https://nodejs.org) and [pnpm](https://pnpm.io).
```bash ```bash
git clone git@github.com:youzan/vant.git git clone git@github.com:vant-ui/vant.git
# Install dependencies # Install dependencies
pnpm i pnpm i

View File

@ -9,8 +9,8 @@ body:
在提交 Bug 报告前,请注意: 在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。 - 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。 - 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。 - 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖。
- type: input - type: input
id: reproduce id: reproduce

View File

@ -9,8 +9,8 @@ body:
在提交 Bug 报告前,请注意: 在提交 Bug 报告前,请注意:
- 确认你的问题无法通过官方文档得到解决。 - 确认你的问题无法通过官方文档得到解决。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的问题。 - 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的问题。
- 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖。 - 如果不是反馈 Bug请到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖。
- type: input - type: input
id: reproduce id: reproduce

View File

@ -9,8 +9,8 @@ body:
在提交功能需求前,请注意: 在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 或 Slot 实现。 - 确认这是一个通用功能,并且无法通过现有的 API 或 Slot 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。 - 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。 - 可以先到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea - type: textarea
id: description id: description

View File

@ -9,8 +9,8 @@ body:
在提交功能需求前,请注意: 在提交功能需求前,请注意:
- 确认这是一个通用功能,并且无法通过现有的 API 实现。 - 确认这是一个通用功能,并且无法通过现有的 API 实现。
- 确认你搜索过 [历史 issue](https://github.com/youzan/vant/issues),并且没有发现同样的需求。 - 确认你搜索过 [历史 issue](https://github.com/vant-ui/vant/issues),并且没有发现同样的需求。
- 可以先到 [Discussions 讨论区](https://github.com/youzan/vant/discussions) 发帖,讨论一下需求是否合理。 - 可以先到 [Discussions 讨论区](https://github.com/vant-ui/vant/discussions) 发帖,讨论一下需求是否合理。
- type: textarea - type: textarea
id: description id: description

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/youzan/vant/blob/dev/.github/CONTRIBUTING.md). 1. Read the [contributing guide](https://github.com/vant-ui/vant/blob/dev/.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

@ -1,4 +1,4 @@
name: Deploy V3 Site name: Deploy V4 Site
on: on:
push: push:
@ -15,7 +15,7 @@ jobs:
- name: Checkout 🛎️ - name: Checkout 🛎️
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: 'dev' ref: 'next'
- name: Install pnpm - name: Install pnpm
run: npm i pnpm@7 -g run: npm i pnpm@7 -g
@ -36,4 +36,5 @@ jobs:
with: with:
branch: gh-pages branch: gh-pages
folder: packages/vant/site-dist folder: packages/vant/site-dist
target-folder: v4
clean: false clean: false

View File

@ -20,6 +20,6 @@ jobs:
with: with:
tag_name: ${{ github.ref }} tag_name: ${{ github.ref }}
body: | body: |
更新内容参见 [CHANGELOG](https://youzan.github.io/vant/#/zh-CN/changelog)。 更新内容参见 [CHANGELOG](https://vant-ui.github.io/vant/#/zh-CN/changelog)。
Please refer to [CHANGELOG](https://youzan.github.io/vant/#/en-US/changelog) for details. Please refer to [CHANGELOG](https://vant-ui.github.io/vant/#/en-US/changelog) for details.

View File

@ -2,7 +2,9 @@ name: Sync to Gitee
on: on:
push: push:
branches: [dev, 2.x, gh-pages] branches: [dev, 2.x, 3.x, gh-pages]
workflow_dispatch:
jobs: jobs:
build: build:
@ -15,6 +17,6 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with: with:
# GitHub 源仓库地址 # GitHub 源仓库地址
source-repo: git@github.com:youzan/vant.git source-repo: git@github.com:vant-ui/vant.git
# Gitee 目标仓库地址 # Gitee 目标仓库地址
destination-repo: git@gitee.com:vant-contrib/vant.git destination-repo: git@gitee.com:vant-contrib/vant.git

View File

@ -1,6 +1,15 @@
name: CI name: CI
on: [push] on:
push:
branches:
- '**'
pull_request:
branches:
- dev
workflow_dispatch:
jobs: jobs:
lint: lint:

1
.gitignore vendored
View File

@ -15,6 +15,5 @@ package-lock.json
es es
lib lib
dist dist
vetur
**/site-dist **/site-dist
changelog.generated.md changelog.generated.md

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npx --no-install lint-staged npx --no-install nano-staged

2
.npmrc
View File

@ -1 +1,3 @@
registry=https://registry.npmmirror.com/ registry=https://registry.npmmirror.com/
strict-peer-dependencies=false

View File

@ -1,3 +0,0 @@
{
"extends": ["@vant/stylelint-config"]
}

View File

@ -1,4 +1,7 @@
Copyright 2016-present Youzan MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -4,21 +4,20 @@
<h1 align="center">Vant</h1> <h1 align="center">Vant</h1>
<p align="center">Mobile UI Components built on Vue</p> <p align="center">Lightweight Mobile UI Components built on 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/youzan/vant/CI/dev?style=flat-square" alt="CI Status" /> <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/youzan/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.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
<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@3/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">
🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a> 🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a>
&nbsp; &nbsp;
🌈 <a href="https://youzan.github.io/vant">文档网站GitHub</a> 🌈 <a href="https://vant-ui.github.io/vant">文档网站GitHub</a>
&nbsp; &nbsp;
🇨🇳 <a href="./README.zh-CN.md">中文版介绍</a> 🇨🇳 <a href="./README.zh-CN.md">中文版介绍</a>
</p> </p>
@ -29,6 +28,7 @@
- 🚀 1KB Component average size (min+gzip) - 🚀 1KB Component average size (min+gzip)
- 🚀 70+ High quality components - 🚀 70+ High quality components
- 🚀 Zero third-party dependencies
- 💪 90%+ Unit test coverage - 💪 90%+ Unit test coverage
- 💪 Written in TypeScript - 💪 Written in TypeScript
- 📖 Extensive documentation and demos - 📖 Extensive documentation and demos
@ -67,14 +67,18 @@ pnpm add vant
```js ```js
import { createApp } from 'vue'; import { createApp } from 'vue';
// 1. Import the components you need
import { Button } from 'vant'; import { Button } from 'vant';
// 2. Import the components style
import 'vant/lib/index.css'; import 'vant/lib/index.css';
const app = createApp(); const app = createApp();
// 3. Register the components you need
app.use(Button); app.use(Button);
``` ```
See more in [Quickstart](https://youzan.github.io/vant#/en-US/quickstart). See more in [Quickstart](https://vant-ui.github.io/vant#/en-US/quickstart).
## Browser Support ## Browser Support
@ -86,11 +90,11 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
| Project | Description | | Project | Description |
| --- | --- | | --- | --- |
| [vant-weapp](https://github.com/youzan/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/youzan/vant/tree/dev/packages/vant-cli) | Scaffold for UI library | | [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | Scaffold for UI library |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant icons | | [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant icons |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers | | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers |
## Community Ecosystem ## Community Ecosystem
@ -106,8 +110,8 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
## Links ## Links
- [Documentation](https://youzan.github.io/vant) - [Documentation](https://vant-ui.github.io/vant)
- [Changelog](https://youzan.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) - [Gitter](https://gitter.im/vant-contrib/discuss?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
## Preview ## Preview
@ -128,7 +132,7 @@ Core contributors of Vant and Vant Weapp:
Thanks to the following friends for their contributions to Vant: Thanks to the following friends for their contributions to Vant:
<a href="https://github.com/youzan/vant/graphs/contributors"> <a href="https://github.com/vant-ui/vant/graphs/contributors">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors"> <img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
</a> </a>

View File

@ -8,17 +8,16 @@
<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/youzan/vant/CI/dev?style=flat-square" alt="CI Status" /> <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/youzan/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.shields.io/jsdelivr/npm/hm/vant?style=flat-square" alt="Jsdelivr Hits">
<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@3/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">
🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a> 🔥 <a href="https://vant-contrib.gitee.io/vant">文档网站(国内)</a>
&nbsp; &nbsp;
🌈 <a href="https://youzan.github.io/vant">文档网站GitHub</a> 🌈 <a href="https://vant-ui.github.io/vant">文档网站GitHub</a>
</p> </p>
--- ---
@ -33,6 +32,7 @@ Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
- 🚀 性能极佳,组件平均体积小于 1KBmin+gzip - 🚀 性能极佳,组件平均体积小于 1KBmin+gzip
- 🚀 70+ 个高质量组件,覆盖移动端主流场景 - 🚀 70+ 个高质量组件,覆盖移动端主流场景
- 🚀 零外部依赖,不依赖三方 npm 包
- 💪 使用 TypeScript 编写,提供完整的类型定义 - 💪 使用 TypeScript 编写,提供完整的类型定义
- 💪 单元测试覆盖率超过 90%,提供稳定性保障 - 💪 单元测试覆盖率超过 90%,提供稳定性保障
- 📖 提供丰富的中英文文档和组件示例 - 📖 提供丰富的中英文文档和组件示例
@ -71,10 +71,14 @@ pnpm add vant
```js ```js
import { createApp } from 'vue'; import { createApp } from 'vue';
// 1. 引入你需要的组件
import { Button } from 'vant'; import { Button } from 'vant';
// 2. 引入组件样式
import 'vant/lib/index.css'; import 'vant/lib/index.css';
const app = createApp(); const app = createApp();
// 3. 注册你需要的组件
app.use(Button); app.use(Button);
``` ```
@ -92,11 +96,11 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
| 项目 | 描述 | | 项目 | 描述 |
| --- | --- | | --- | --- |
| [vant-weapp](https://github.com/youzan/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/youzan/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 | | [vant-cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 |
| [vant-icons](https://github.com/youzan/vant/tree/dev/packages/vant-icons) | Vant 图标库 | | [vant-icons](https://github.com/vant-ui/vant/tree/dev/packages/vant-icons) | Vant 图标库 |
| [vant-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 | | [vant-touch-emulator](https://github.com/vant-ui/vant/tree/dev/packages/vant-touch-emulator) | 在桌面端使用 Vant 的辅助库 |
## 社区生态 ## 社区生态
@ -136,7 +140,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
感谢以下小伙伴们为 Vant 发展做出的贡献: 感谢以下小伙伴们为 Vant 发展做出的贡献:
<a href="https://github.com/youzan/vant/graphs/contributors"> <a href="https://github.com/vant-ui/vant/graphs/contributors">
<img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors"> <img src="https://opencollective.com/vant/contributors.svg?width=890&button=false" alt="contributors">
</a> </a>
@ -144,7 +148,7 @@ Vant 3/4 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一
修改代码请阅读我们的 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)。 修改代码请阅读我们的 [贡献指南](https://vant-contrib.gitee.io/vant/#/zh-CN/contribution)。
使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)。 使用过程中发现任何问题都可以提 [Issue](https://github.com/vant-ui/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/vant-ui/vant/pulls)。
## 开源协议 ## 开源协议

View File

@ -9,22 +9,29 @@
"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"
}, },
"lint-staged": { "nano-staged": {
"*.md": "prettier --write", "*.md": "prettier --write",
"*.{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"
"*.{vue,css,less}": "stylelint --fix"
}, },
"packageManager": "pnpm@7.1.6", "packageManager": "pnpm@7.11.0",
"devDependencies": { "devDependencies": {
"@vant/cli": "workspace:*", "@vant/cli": "workspace:*",
"@vant/eslint-config": "workspace:*", "@vant/eslint-config": "workspace:*",
"@vant/stylelint-config": "workspace:*", "eslint": "^8.23.0",
"eslint": "^8.2.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"lint-staged": "^12.1.2", "nano-staged": "^0.8.0",
"prettier": "^2.5.0", "prettier": "^2.7.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2"
"stylelint": "^13.13.1" },
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@algolia/client-search",
"@types/react",
"react",
"react-dom"
]
}
} }
} }

View File

@ -0,0 +1,10 @@
MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -15,18 +15,17 @@
"build": "vant-cli build", "build": "vant-cli build",
"release": "vant-cli release", "release": "vant-cli release",
"test:coverage": "open test/coverage/index.html", "test:coverage": "open test/coverage/index.html",
"build-site": "vant-cli build-site && gh-pages -d site-dist" "build-site": "vant-cli build-site && npx gh-pages -d site-dist"
}, },
"author": "", "author": "",
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged", "pre-commit": "nano-staged",
"commit-msg": "vant-cli commit-lint" "commit-msg": "vant-cli commit-lint"
} }
}, },
"lint-staged": { "nano-staged": {
"*.{ts,tsx,js,jsx,vue}": "eslint --fix", "*.{ts,tsx,js,jsx,vue}": "eslint --fix"
"*.{vue,css,less,scss}": "stylelint --fix"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "^2.6.11", "vue": "^2.6.11",
@ -43,11 +42,6 @@
"@vant" "@vant"
] ]
}, },
"stylelint": {
"extends": [
"@vant/stylelint-config"
]
},
"prettier": { "prettier": {
"singleQuote": true "singleQuote": true
}, },

View File

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

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npx --no-install lint-staged npx --no-install nano-staged

View File

@ -17,16 +17,15 @@
"build": "vant-cli build", "build": "vant-cli build",
"build:site": "vant-cli build-site", "build:site": "vant-cli build-site",
"release": "vant-cli release --tag next", "release": "vant-cli release --tag next",
"release:site": "pnpm build:site && gh-pages -d site-dist", "release:site": "pnpm build:site && npx gh-pages -d site-dist",
"test:watch": "vant-cli test --watch", "test:watch": "vant-cli test --watch",
"test:coverage": "open test/coverage/index.html" "test:coverage": "open test/coverage/index.html"
}, },
"author": "", "author": "",
"lint-staged": { "nano-staged": {
"*.md": "prettier --write", "*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write", "*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix", "*.{ts,tsx,js,vue}": "eslint --fix"
"*.{vue,css,less,scss}": "stylelint --fix"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "^3.0.0" "vue": "^3.0.0"
@ -42,11 +41,6 @@
"@vant" "@vant"
] ]
}, },
"stylelint": {
"extends": [
"@vant/stylelint-config"
]
},
"prettier": { "prettier": {
"singleQuote": true "singleQuote": true
}, },

View File

@ -7,3 +7,7 @@
<demo-button color="#03a9f4" style="margin-left: 15px">按钮</demo-button> <demo-button color="#03a9f4" style="margin-left: 15px">按钮</demo-button>
</demo-block> </demo-block>
</template> </template>
<script setup>
import DemoButton from '../index.vue';
</script>

View File

@ -1,6 +1,6 @@
{ {
"name": "create-vant-cli-app", "name": "create-vant-cli-app",
"version": "2.0.0", "version": "2.0.1",
"description": "Create Vant CLI App", "description": "Create Vant CLI App",
"main": "lib/index.js", "main": "lib/index.js",
"bin": { "bin": {
@ -24,24 +24,24 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/youzan/vant.git", "url": "https://github.com/vant-ui/vant.git",
"directory": "packages/create-vant-cli-app" "directory": "packages/create-vant-cli-app"
}, },
"bugs": "https://github.com/youzan/vant/issues", "bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@types/inquirer": "^8.1.3", "@types/inquirer": "^8.2.3",
"release-it": "^14.11.6", "release-it": "^15.4.1",
"typescript": "~4.5.2" "typescript": "^4.8.2"
}, },
"dependencies": { "dependencies": {
"chalk": "^4.1.2",
"consola": "^2.11.3", "consola": "^2.11.3",
"fast-glob": "^3.2.4", "fast-glob": "^3.2.11",
"fs-extra": "^10.0.0", "fs-extra": "^10.1.0",
"inquirer": "^8.0.0" "inquirer": "^8.2.4",
"picocolors": "^1.0.0"
}, },
"release-it": { "release-it": {
"git": { "git": {

View File

@ -1,6 +1,6 @@
import fs from 'fs-extra'; import fs from 'fs-extra';
import glob from 'fast-glob'; import glob from 'fast-glob';
import chalk from 'chalk'; import color from 'picocolors';
import consola from 'consola'; import consola from 'consola';
import { prompt } from 'inquirer'; import { prompt } from 'inquirer';
import { sep, join } from 'path'; import { sep, join } from 'path';
@ -64,7 +64,7 @@ export class VanGenerator {
writing() { writing() {
console.log(); console.log();
consola.info(`Creating project in ${chalk.green(this.outputDir)}\n`); consola.info(`Creating project in ${color.green(this.outputDir)}\n`);
// see https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows // see https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
const templatePath = join(GENERATOR_DIR, this.inputs.vueVersion).replace( const templatePath = join(GENERATOR_DIR, this.inputs.vueVersion).replace(
@ -99,16 +99,16 @@ export class VanGenerator {
fs.writeFileSync(to, content); fs.writeFileSync(to, content);
const name = to.replace(this.outputDir + sep, ''); const name = to.replace(this.outputDir + sep, '');
consola.success(`${chalk.green('create')} ${name}`); consola.success(`${color.green('create')} ${name}`);
} }
end() { end() {
const { name } = this.inputs; const { name } = this.inputs;
console.log(); console.log();
consola.success(`Successfully created ${chalk.yellow(name)}.`); consola.success(`Successfully created ${color.yellow(name)}.`);
consola.success( consola.success(
`Run ${chalk.yellow( `Run ${color.yellow(
`cd ${name} && git init && yarn && yarn dev` `cd ${name} && git init && yarn && yarn dev`
)} to start development!` )} to start development!`
); );

View File

@ -0,0 +1,10 @@
MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/area-data", "name": "@vant/area-data",
"version": "1.3.1", "version": "1.3.2",
"description": "Vant 省市区数据", "description": "Vant 省市区数据",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs", "module": "dist/index.esm.mjs",
@ -29,16 +29,16 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/youzan/vant.git", "url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-area-data" "directory": "packages/vant-area-data"
}, },
"bugs": "https://github.com/youzan/vant/issues", "bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"esbuild": "^0.14.29", "esbuild": "^0.14.54",
"release-it": "^14.2.2", "release-it": "^15.4.1",
"typescript": "~4.5.2" "typescript": "^4.8.2"
}, },
"release-it": { "release-it": {
"git": { "git": {

View File

@ -1150,10 +1150,10 @@ export const areaList = {
232701: '漠河市', 232701: '漠河市',
232721: '呼玛县', 232721: '呼玛县',
232722: '塔河县', 232722: '塔河县',
232790: '松岭区', 232761: '加格达奇区',
232791: '呼中区', 232762: '松岭区',
232792: '加格达奇区', 232763: '新林区',
232793: '新林区', 232764: '呼中区',
310101: '黄浦区', 310101: '黄浦区',
310104: '徐汇区', 310104: '徐汇区',
310105: '长宁区', 310105: '长宁区',

10
packages/vant-cli/LICENSE Normal file
View File

@ -0,0 +1,10 @@
MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -10,7 +10,7 @@ Vant CLI is a tool for building vue component library. You can quickly build a f
- Provides rich commands covering the complete process from development to deploy - Provides rich commands covering the complete process from development to deploy
- Based on conventional directory structure. Generate elegant document website and component examples automatically. - Based on conventional directory structure. Generate elegant document website and component examples automatically.
- ESlint Stylelint built-in. - ESlint built-in.
- Support Tree Shaking/Theme Customization/Import on Demand - Support Tree Shaking/Theme Customization/Import on Demand
### Quickstart ### Quickstart
@ -47,19 +47,15 @@ Please add the followed config to `package.json` file.
"release": "vant-cli release", "release": "vant-cli release",
"build-site": "vant-cli build-site" "build-site": "vant-cli build-site"
}, },
"lint-staged": { "nano-staged": {
"*.md": "prettier --write", "*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write", "*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix", "*.{ts,tsx,js,vue}": "eslint --fix"
"*.{vue,css,less,scss}": "stylelint --fix"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
"extends": ["@vant"] "extends": ["@vant"]
}, },
"stylelint": {
"extends": ["@vant/stylelint-config"]
},
"prettier": { "prettier": {
"singleQuote": true "singleQuote": true
}, },
@ -69,7 +65,7 @@ Please add the followed config to `package.json` file.
## More Details ## More Details
- [cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.md) - [cli](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.md)
- [config](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.md) - [config](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.md)
- [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md) - [directory structure](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.md)
- [CHANGELOG](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md) - [CHANGELOG](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)

View File

@ -1,12 +1,13 @@
# Vant CLI # Vant CLI
Vant CLI 是一个 Vue 组件库构建工具,通过 Vant CLI 可以快速搭建一套功能完备的 Vue 组件库。 Vant CLI 是一个基于 Vite 实现的 Vue 组件库构建工具,通过 Vant CLI 可以快速搭建一套功能完备的 Vue 组件库。
### 特性 ### 特性
- 基于 Vite 实现,享受愉悦的开发体验
- 提供丰富的命令,涵盖从开发测试到构建发布的完整流程 - 提供丰富的命令,涵盖从开发测试到构建发布的完整流程
- 基于约定的目录结构,自动生成优雅的文档站点和组件示例 - 基于约定的目录结构,自动生成优雅的文档站点和组件示例
- 内置 ESLint、Stylelint 校验规则,提交代码时自动执行校验 - 内置 ESLint 校验规则,提交代码时自动执行校验
- 构建后的组件库默认支持按需引入、主题定制、Tree Shaking - 构建后的组件库默认支持按需引入、主题定制、Tree Shaking
### 快速上手 ### 快速上手
@ -43,19 +44,15 @@ pnpm add @vant/cli -D
"release": "vant-cli release", "release": "vant-cli release",
"build-site": "vant-cli build-site" "build-site": "vant-cli build-site"
}, },
"lint-staged": { "nano-staged": {
"*.md": "prettier --write", "*.md": "prettier --write",
"*.{ts,tsx,js,vue,less,scss}": "prettier --write", "*.{ts,tsx,js,vue,less,scss}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix", "*.{ts,tsx,js,vue}": "eslint --fix"
"*.{vue,css,less,scss}": "stylelint --fix"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
"extends": ["@vant"] "extends": ["@vant"]
}, },
"stylelint": {
"extends": ["@vant/stylelint-config"]
},
"prettier": { "prettier": {
"singleQuote": true "singleQuote": true
}, },
@ -65,7 +62,7 @@ pnpm add @vant/cli -D
## 详细文档 ## 详细文档
- [命令](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md) - [命令](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/commands.zh-CN.md)
- [配置指南](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md) - [配置指南](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/config.zh-CN.md)
- [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md) - [目录结构](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/docs/directory.zh-CN.md)
- [更新日志](https://github.com/youzan/vant/tree/dev/packages/vant-cli/changelog.md) - [更新日志](https://github.com/vant-ui/vant/tree/dev/packages/vant-cli/changelog.md)

View File

@ -1,5 +1,52 @@
# 更新日志 # 更新日志
## v5.0.0 (未发布)
### 依赖升级
对以下依赖进行了大版本升级:
- vite v3
- @vitejs/plugin-vue v3
- @vitejs/plugin-vue-jsx v2
### 依赖精简
- 不再默认安装 `gh-pages` 依赖,请按照如下方式更新 `package.json`
```diff
- "release:site": "pnpm build:site && gh-pages -d site-dist",
+ "release:site": "pnpm build:site && npx gh-pages -d site-dist",
```
- 不再默认内置 `stylelint`,需要的话可以自行安装:
```bash
yarn add stylelint@13 @vant/stylelint-config
```
### 移除 vetur 相关配置
由于 Vue 3 推荐使用 volar 而不是 vetur因此移除了 vetur 相关的配置文件。
现在会默认生成 WebStorm 所需的 web-types.json 文件到 `lib/web-types.json` 目录下。
## v4.0.4
`2022-07-02`
- 修复构建 sfc 文件的类型定义时报错的问题
## v4.0.3
`2022-07-02`
- 新增 `build.bundleOptions` 配置项
- 新增 `css.removeSourceFile` 配置项
- 修复编译后的 script setup 中,引用的组件不生效的问题
- 移除未使用的 esm bundle
- 移除未使用的 ssr.js 文件
## v4.0.2 ## v4.0.2
`2022-05-14` `2022-05-14`
@ -396,15 +443,15 @@ yarn add sass
`2020-03-29` `2020-03-29`
- 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/youzan/vant/pull/5928)) - 优化网站导航栏在大屏上的适配 ([#5928](https://github.com/vant-ui/vant/pull/5928))
### v2.3.0 ### v2.3.0
`2020-03-25` `2020-03-25`
- build 命令支持编译 scoped 样式 ([#5910](https://github.com/youzan/vant/pull/5910)) - build 命令支持编译 scoped 样式 ([#5910](https://github.com/vant-ui/vant/pull/5910))
- build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/youzan/vant/issues/5899)) - build 命令支持生成 WebStorm 组件定义文件 ([#5899](https://github.com/vant-ui/vant/issues/5899))
- clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/youzan/vant/issues/5895)) - clean 命令现在会移除而不是清空文件夹 ([#5895](https://github.com/vant-ui/vant/issues/5895))
- 升级 @vant/markdown-vetur 2.0.0 - 升级 @vant/markdown-vetur 2.0.0
### v2.2.8 ### v2.2.8
@ -438,7 +485,7 @@ yarn add sass
`2020-02-14` `2020-02-14`
- 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/youzan/vant/pull/5655) - 修复在 windows 上构建出的样式入口文件路径错误的问题 ([#5655](https://github.com/vant-ui/vant/pull/5655)
### v2.2.3 ### v2.2.3
@ -450,14 +497,14 @@ yarn add sass
`2020-02-05` `2020-02-05`
- 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/youzan/vant/pull/5626)) - 修复在 windows 上获取 markdown 路径错误的问题 ([#5626](https://github.com/vant-ui/vant/pull/5626))
### v2.2.1 ### v2.2.1
`2020-02-04` `2020-02-04`
- 升级 babel@7.8 - 升级 babel@7.8
- 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/youzan/vant/pull/5620)) - 修复切换版本时跳转 undefined 的问题 ([#5620](https://github.com/vant-ui/vant/pull/5620))
### v2.2.0 ### v2.2.0

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

View File

@ -103,7 +103,7 @@ module.exports = {
- Type: `string` - Type: `string`
- Default: `'less'` - Default: `'less'`
CSS preprocess Config, support `less` and `sass`. Use `less` by default. CSS preprocessor config, support `less` and `sass`. Use `less` by default.
```js ```js
module.exports = { module.exports = {
@ -115,6 +115,23 @@ module.exports = {
}; };
``` ```
### build.css.removeSourceFile
- Type: `boolean`
- Default: `'false'`
Whether to remove the source style files after build.
```js
module.exports = {
build: {
css: {
removeSourceFile: true,
},
},
};
```
### build.site.publicPath ### build.site.publicPath
- Type: `string` - Type: `string`
@ -204,6 +221,45 @@ module.exports = {
`npm` package manager. `npm` package manager.
### build.bundleOptions
- Type: `BundleOptions[]`
Specify the format of the bundled output.
The type of `BundleOptions`:
```ts
type BundleOption = {
// Whether to minify code (Tips: es format output can't be minified by vite)
minify?: boolean;
// Formats, can be set to 'es' | 'cjs' | 'umd' | 'iife'
formats: LibraryFormats[];
// Dependencies to external (Vue is externaled by default)
external?: string[];
};
```
Default value
```ts
const DEFAULT_OPTIONS: BundleOption[] = [
{
minify: false,
formats: ['umd'],
},
{
minify: true,
formats: ['umd'],
},
{
minify: false,
formats: ['es', 'cjs'],
external: allDependencies,
},
];
```
### site.title ### site.title
- Type: `string` - Type: `string`
@ -269,7 +325,7 @@ module.exports = {
versions: [ versions: [
{ {
label: 'v1', label: 'v1',
link: 'https://youzan.github.io/vant/v1/', link: 'https://vant-ui.github.io/vant/v1/',
}, },
], ],
}, },
@ -324,12 +380,19 @@ Customize iframe URL.
Customize HTML meta tag, key means name, value means content. Customize HTML meta tag, key means name, value means content.
### site.headHtml
- Type: `string`
- Default: `undefined`
Insert a custom HTML content in the `<head>` tag.
### site.enableVConsole ### site.enableVConsole
- Type: `boolean` - Type: `boolean`
- Default: `false` - Default: `false`
Should use [vConsole](https://github.com/Tencent/vConsole) to debug when dev. For mobile. Whether to enable [vConsole](https://github.com/Tencent/vConsole) debugging in dev, usually used for mobile debugging.
## PostCSS ## PostCSS

View File

@ -115,6 +115,23 @@ module.exports = {
}; };
``` ```
### build.css.removeSourceFile
- Type: `boolean`
- Default: `'false'`
是否在构建后移除样式文件的源代码。
```js
module.exports = {
build: {
css: {
removeSourceFile: true,
},
},
};
```
### build.site.publicPath ### build.site.publicPath
- Type: `string` - Type: `string`
@ -206,6 +223,45 @@ module.exports = {
指定使用的包管理器。 指定使用的包管理器。
### build.bundleOptions
- Type: `BundleOptions[]`
指定打包后产物的格式。
产物格式由三个配置项控制:
```ts
type BundleOption = {
// 是否压缩代码(注意 es 产物无法被 vite 压缩)
minify?: boolean;
// 产物类型,可选值为 'es' | 'cjs' | 'umd' | 'iife'
formats: LibraryFormats[];
// 需要 external 的依赖Vue 默认会被 external
external?: string[];
};
```
该选项的默认值为:
```ts
const DEFAULT_OPTIONS: BundleOption[] = [
{
minify: false,
formats: ['umd'],
},
{
minify: true,
formats: ['umd'],
},
{
minify: false,
formats: ['es', 'cjs'],
external: allDependencies,
},
];
```
### site.title ### site.title
- Type: `string` - Type: `string`
@ -271,7 +327,7 @@ module.exports = {
versions: [ versions: [
{ {
label: 'v1', label: 'v1',
link: 'https://youzan.github.io/vant/v1/', link: 'https://vant-ui.github.io/vant/v1/',
}, },
], ],
}, },
@ -281,7 +337,7 @@ module.exports = {
### site.baiduAnalytics ### site.baiduAnalytics
- Type: `object` - Type: `object`
- Default: `undefied` - Default: `undefined`
文档网站的百度统计配置,添加这项配置后,会自动在构建文档网站时加载百度统计的脚本。 文档网站的百度统计配置,添加这项配置后,会自动在构建文档网站时加载百度统计的脚本。
@ -328,6 +384,13 @@ module.exports = {
配置 HTML 中的 meta 标签,对象的 key 为 namevalue 为 content。 配置 HTML 中的 meta 标签,对象的 key 为 namevalue 为 content。
### site.headHtml
- Type: `string`
- Default: `undefined`
`<head>` 标签中插入一段自定义的 HTML 内容。
### site.enableVConsole ### site.enableVConsole
- Type: `boolean` - Type: `boolean`

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/cli", "name": "@vant/cli",
"version": "4.0.2", "version": "4.0.4",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"typings": "lib/index.d.ts", "typings": "lib/index.d.ts",
@ -32,68 +32,63 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/youzan/vant.git", "url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-cli" "directory": "packages/vant-cli"
}, },
"bugs": "https://github.com/youzan/vant/issues", "bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@jest/types": "^27.5.1",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@types/less": "^3.0.3", "@types/less": "^3.0.3",
"@types/markdown-it": "^12.2.3", "@types/markdown-it": "^12.2.3",
"@types/react": "^18", "react": "^18.2.0",
"@jest/types": "^27", "react-dom": "^18.2.0",
"vue": "^3.2.27", "vue": "^3.2.38"
"react": "^18",
"react-dom": "^18"
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.16.0", "@babel/core": "^7.18.13",
"@babel/preset-typescript": "^7.16.0", "@babel/preset-typescript": "^7.18.6",
"@docsearch/css": "^3.0.0", "@docsearch/css": "^3.2.1",
"@docsearch/js": "^3.0.0", "@docsearch/js": "^3.2.1",
"@types/jest": "^27.0.3", "@types/jest": "^27.5.2",
"@vant/eslint-config": "^3.3.2", "@vant/eslint-config": "^3.5.0",
"@vant/markdown-vetur": "^2.3.0", "@vant/touch-emulator": "^1.4.0",
"@vant/stylelint-config": "^1.4.2", "@vitejs/plugin-vue": "^3.0.3",
"@vant/touch-emulator": "^1.3.2", "@vitejs/plugin-vue-jsx": "^2.0.1",
"@vitejs/plugin-vue": "^2.0.0",
"@vitejs/plugin-vue-jsx": "^1.3.3",
"@vue/babel-plugin-jsx": "^1.1.1", "@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.0", "autoprefixer": "^10.4.8",
"chalk": "^4.1.2", "commander": "^9.4.0",
"commander": "^8.3.0",
"consola": "^2.15.3", "consola": "^2.15.3",
"conventional-changelog": "^3.1.24", "conventional-changelog": "^3.1.25",
"esbuild": "^0.14.29", "esbuild": "^0.14.54",
"eslint": "^8.1.0", "eslint": "^8.23.0",
"execa": "^5.1.1", "execa": "^5.1.1",
"fast-glob": "^3.2.7", "fast-glob": "^3.2.11",
"fs-extra": "^10.0.0", "fs-extra": "^10.1.0",
"gh-pages": "^3.2.3",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"highlight.js": "^11.3.1", "highlight.js": "^11.6.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"jest": "^27.3.1", "jest": "^27.5.1",
"jest-canvas-mock": "^2.3.1", "jest-canvas-mock": "^2.4.0",
"jest-serializer-html": "^7.1.0", "jest-serializer-html": "^7.1.0",
"less": "^4.1.2", "less": "^4.1.3",
"lint-staged": "^12.1.2", "markdown-it": "^12.3.2",
"markdown-it": "^12.2.0", "markdown-it-anchor": "^8.6.4",
"markdown-it-anchor": "^8.4.1", "nano-staged": "^0.8.0",
"ora": "^6.0.1", "nanospinner": "^1.1.0",
"postcss": "^8.3.11", "picocolors": "^1.0.0",
"postcss-load-config": "^3.1.0", "postcss": "^8.4.16",
"prettier": "^2.5.0", "postcss-load-config": "^3.1.4",
"release-it": "^14.11.6", "prettier": "^2.7.1",
"stylelint": "^13.0.0", "release-it": "^15.4.1",
"transliteration": "^2.2.0", "transliteration": "^2.3.5",
"typescript": "^4.5.2", "typescript": "^4.8.2",
"vite": "^2.9.0", "vite": "^3.0.9",
"vite-plugin-html": "^2.1.1", "vite-plugin-html": "^2.1.2",
"vite-plugin-md": "^0.11.4", "vite-plugin-md": "^0.11.9",
"vue-router": "^4.0.12" "vue-router": "^4.1.5"
}, },
"release-it": { "release-it": {
"git": { "git": {

View File

@ -1,7 +1,4 @@
/** import { ref } from 'vue';
* 同步父窗口和 iframe vue-router 状态
*/
import { config } from 'site-desktop-shared'; import { config } from 'site-desktop-shared';
let queue = []; let queue = [];
@ -62,6 +59,49 @@ export function syncPathToChild() {
} }
} }
export function syncThemeToChild(theme) {
const iframe = document.querySelector('iframe');
if (iframe) {
iframeReady(() => {
iframe.contentWindow.postMessage(
{
type: 'updateTheme',
value: theme,
},
'*'
);
});
}
}
export function getDefaultTheme() {
const cache = window.localStorage.getItem('vantTheme');
if (cache) {
return cache;
}
const useDark =
window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches;
return useDark ? 'dark' : 'light';
}
export function useCurrentTheme() {
const theme = ref(getDefaultTheme());
window.addEventListener('message', (event) => {
if (event.data?.type !== 'updateTheme') {
return;
}
const newTheme = event.data?.value || '';
theme.value = newTheme;
});
return theme;
}
export function listenToSyncPath(router) { export function listenToSyncPath(router) {
window.addEventListener('message', (event) => { window.addEventListener('message', (event) => {
if (event.data?.type !== 'replacePath') { if (event.data?.type !== 'replacePath') {

View File

@ -1,16 +1,15 @@
@import './var'; @import './vars.less';
@import './font.less';
body { body {
min-width: 1100px; min-width: 1100px;
margin: 0; margin: 0;
overflow-x: auto; overflow-x: auto;
color: @van-doc-black; color: var(--van-doc-text-color-2);
font-size: 16px; font-size: 16px;
font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui',
'Hiragino Sans GB', 'Microsoft Yahei', sans-serif; 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
background-color: @van-doc-background-color; background-color: var(--van-doc-background);
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
@ -42,8 +41,8 @@ a {
.van-doc-row { .van-doc-row {
width: 100%; width: 100%;
@media (min-width: @van-doc-row-max-width) { @media (min-width: var(--van-doc-row-max-width)) {
width: @van-doc-row-max-width; width: var(--van-doc-row-max-width);
margin: 0 auto; margin: 0 auto;
} }
} }

View File

@ -1,163 +0,0 @@
/* cyrillic-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-weight: 400;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans Regular'), local('OpenSans-Regular'),
url(https://b.yzcdn.cn/vant/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOX-hpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOVuhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXuhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUehpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXehpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOXOhpKKSTj5PW.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-weight: 600;
font-family: 'Open Sans';
font-style: normal;
src: local('Open Sans SemiBold'), local('OpenSans-SemiBold'),
url(https://b.yzcdn.cn/vant/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2)
format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}

View File

@ -1,20 +1,18 @@
@import './var';
code { code {
position: relative; position: relative;
display: block; display: block;
padding: 16px 20px; padding: 16px 20px;
overflow-x: auto; overflow-x: auto;
color: @van-doc-code-color; color: var(--van-doc-code-color);
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
font-family: @van-doc-code-font-family; font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
line-height: 26px; line-height: 26px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
background-color: #f8f8f8; background-color: var(--van-doc-code-background);
border-radius: @van-doc-border-radius; border-radius: var(--van-doc-border-radius);
} }
pre { pre {
@ -33,7 +31,7 @@ pre {
} }
.hljs-subst { .hljs-subst {
color: @van-doc-code-color; color: var(--van-doc-code-color);
} }
.hljs-string, .hljs-string,
@ -42,18 +40,18 @@ pre {
.hljs-template-tag, .hljs-template-tag,
.hljs-template-variable, .hljs-template-variable,
.hljs-addition { .hljs-addition {
color: @van-doc-green; color: var(--van-doc-green);
} }
.hljs-comment, .hljs-comment,
.hljs-quote { .hljs-quote {
color: #999; color: var(--van-doc-code-comment-color);
} }
.hljs-params, .hljs-params,
.hljs-keyword, .hljs-keyword,
.hljs-attribute { .hljs-attribute {
color: @van-doc-purple; color: var(--van-doc-purple);
} }
.hljs-deletion, .hljs-deletion,

View File

@ -1,27 +0,0 @@
@van-doc-black: #323233;
@van-doc-blue: #1989fa;
@van-doc-purple: #8080ff;
@van-doc-fuchsia: #a7419e;
@van-doc-green: #4fc08d;
@van-doc-text-color: #34495e;
@van-doc-text-light-blue: rgba(69, 90, 100, 0.6);
@van-doc-background-color: #f7f8fa;
@van-doc-grey: #999;
@van-doc-dark-grey: #666;
@van-doc-light-grey: #ccc;
@van-doc-border-color: #f1f4f8;
@van-doc-code-color: #58727e;
@van-doc-code-background-color: #f1f4f8;
@van-doc-code-font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
@van-doc-padding: 24px;
@van-doc-row-max-width: 1680px;
@van-doc-nav-width: 220px;
@van-doc-border-radius: 20px;
// header
@van-doc-header-top-height: 64px;
@van-doc-header-bottom-height: 50px;
// simulator
@van-doc-simulator-width: 360px;
@van-doc-simulator-height: 620px;

View File

@ -0,0 +1,74 @@
body {
// colors
--van-doc-black: #000;
--van-doc-white: #fff;
--van-doc-gray-1: #f7f8fa;
--van-doc-gray-2: #f2f3f5;
--van-doc-gray-3: #ebedf0;
--van-doc-gray-4: #dcdee0;
--van-doc-gray-5: #c8c9cc;
--van-doc-gray-6: #969799;
--van-doc-gray-7: #646566;
--van-doc-gray-8: #323233;
--van-doc-blue: #1989fa;
--van-doc-green: #07c160;
// sizes
--van-doc-padding: 24px;
--van-doc-row-max-width: 1680px;
--van-doc-nav-width: 220px;
--van-doc-border-radius: 20px;
--van-doc-simulator-width: 360px;
--van-doc-simulator-height: 620px;
--van-doc-header-top-height: 64px;
}
.van-doc-theme-light {
// text
--van-doc-text-color-1: var(--van-doc-black);
--van-doc-text-color-2: var(--van-doc-gray-8);
--van-doc-text-color-3: #34495e;
--van-doc-text-color-4: var(--van-doc-gray-6);
--van-doc-link-color: var(--van-doc-blue);
// background
--van-doc-background: #eff2f5;
--van-doc-background-2: var(--van-doc-white);
--van-doc-background-3: var(--van-doc-white);
--van-doc-header-background: #011f3c;
--van-doc-border-color: var(--van-doc-gray-2);
// code
--van-doc-code-color: #58727e;
--van-doc-code-comment-color: var(--van-doc-gray-6);
--van-doc-code-background: var(--van-doc-gray-1);
// blockquote
--van-doc-blockquote-color: #4994df;
--van-doc-blockquote-background: #ecf9ff;
}
.van-doc-theme-dark {
// text
--van-doc-text-color-1: var(--van-doc-white);
--van-doc-text-color-2: rgba(255, 255, 255, 0.9);
--van-doc-text-color-3: rgba(255, 255, 255, 0.75);
--van-doc-text-color-4: rgba(255, 255, 255, 0.6);
--van-doc-link-color: #1bb5fe;
// background
--van-doc-background: #202124;
--van-doc-background-2: rgba(255, 255, 255, 0.06);
--van-doc-background-3: rgba(255, 255, 255, 0.1);
--van-doc-header-background: rgba(1, 31, 60, 0.3);
--van-doc-border-color: #3a3a3c;
// code
--van-doc-code-color: rgba(200, 200, 200, 0.85);
--van-doc-code-comment-color: var(--van-doc-gray-7);
--van-doc-code-background: rgba(0, 0, 0, 0.24);
// blockquote
--van-doc-blockquote-color: #bae6fd;
--van-doc-blockquote-background: rgba(7, 89, 133, 0.25);
}

View File

@ -8,6 +8,7 @@
:simulator="simulator" :simulator="simulator"
:has-simulator="hasSimulator" :has-simulator="hasSimulator"
:lang-configs="langConfigs" :lang-configs="langConfigs"
:dark-mode-class="darkModeClass"
> >
<router-view /> <router-view />
</van-doc> </van-doc>
@ -27,6 +28,7 @@ export default {
data() { data() {
return { return {
hasSimulator: true, hasSimulator: true,
darkModeClass: config.site.darkModeClass,
}; };
}, },
@ -70,18 +72,18 @@ export default {
watch: { watch: {
// eslint-disable-next-line // eslint-disable-next-line
'$route.path'() { '$route.path'() {
this.setTitleAndToogleSimulator(); this.setTitleAndToggleSimulator();
}, },
lang(val) { lang(val) {
setLang(val); setLang(val);
this.setTitleAndToogleSimulator(); this.setTitleAndToggleSimulator();
}, },
config: { config: {
handler(val) { handler(val) {
if (val) { if (val) {
this.setTitleAndToogleSimulator(); this.setTitleAndToggleSimulator();
} }
}, },
immediate: true, immediate: true,
@ -100,7 +102,7 @@ export default {
}, },
methods: { methods: {
setTitleAndToogleSimulator() { setTitleAndToggleSimulator() {
let { title } = this.config; let { title } = this.config;
const navItems = this.config.nav.reduce( const navItems = this.config.nav.reduce(

View File

@ -18,18 +18,18 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-container { .van-doc-container {
box-sizing: border-box; box-sizing: border-box;
padding-left: @van-doc-nav-width; padding-left: var(--van-doc-nav-width);
overflow: hidden; overflow: hidden;
&--with-simulator { &--with-simulator {
padding-right: @van-doc-simulator-width + @van-doc-padding; padding-right: calc(
var(--van-doc-simulator-width) + var(--van-doc-padding)
);
@media (max-width: 1100px) { @media (max-width: 1100px) {
padding-right: @van-doc-simulator-width - 8px; padding-right: calc(var(--van-doc-simulator-width) - 8px);
} }
} }
} }

View File

@ -82,14 +82,12 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-card { .van-doc-card {
margin-bottom: 24px; margin-bottom: 24px;
padding: 24px; padding: 24px;
background-color: #fff; background-color: var(--van-doc-background-2);
border-radius: @van-doc-border-radius; border-radius: var(--van-doc-border-radius);
box-shadow: 0 8px 12px #ebedf0; overflow: auto;
> pre code { > pre code {
position: relative; position: relative;
@ -144,15 +142,15 @@ export default {
> table a, > table a,
> blockquote a { > blockquote a {
margin: 0 1px; margin: 0 1px;
color: @van-doc-blue; color: var(--van-doc-link-color);
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
&:hover { &:hover {
color: darken(@van-doc-blue, 10%); opacity: 0.8;
} }
&:active { &:active {
color: darken(@van-doc-blue, 20%); opacity: 0.6;
} }
} }
@ -160,7 +158,6 @@ export default {
> h4, > h4,
> h5, > h5,
> h6 { > h6 {
color: @van-doc-black;
font-weight: normal; font-weight: normal;
line-height: 1.6; line-height: 1.6;
@ -189,23 +186,19 @@ export default {
> p { > p {
margin-top: 8px; margin-top: 8px;
} color: var(--van-doc-text-color-3);
> p,
> blockquote p {
color: @van-doc-text-color;
font-size: 15px; font-size: 15px;
line-height: 26px; line-height: 26px;
strong { strong {
color: black; color: var(--van-doc-text-color-1);
} }
} }
> table { > table {
width: 100%; width: 100%;
margin-top: 12px; margin-top: 12px;
color: @van-doc-text-color; color: var(--van-doc-text-color-3);
font-size: 14px; font-size: 14px;
line-height: 1.5; line-height: 1.5;
border-collapse: collapse; border-collapse: collapse;
@ -226,7 +219,7 @@ export default {
td { td {
padding: 8px; padding: 8px;
border-top: 1px solid @van-doc-code-background-color; border-top: 1px solid var(--van-doc-border-color);
&:first-child { &:first-child {
padding-left: 0; padding-left: 0;
@ -235,10 +228,10 @@ export default {
code { code {
margin: 0; margin: 0;
padding: 2px 6px; padding: 2px 6px;
color: @van-doc-blue; color: var(--van-doc-blue);
font-weight: 600; font-weight: 600;
font-size: 11px; font-size: 11px;
background-color: fade(@van-doc-blue, 10%); background-color: rgba(25, 137, 250, 0.15);
border-radius: 20px; border-radius: 20px;
} }
} }
@ -250,9 +243,9 @@ export default {
em { em {
display: inline-block; display: inline-block;
color: @van-doc-green; color: var(--van-doc-green);
font-size: 14px; font-size: 14px;
font-family: @van-doc-code-font-family; font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
font-style: normal; font-style: normal;
max-width: 300px; max-width: 300px;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
@ -268,7 +261,7 @@ export default {
position: relative; position: relative;
margin: 5px 0 5px 10px; margin: 5px 0 5px 10px;
padding-left: 15px; padding-left: 15px;
color: @van-doc-text-color; color: var(--van-doc-text-color-3);
font-size: 15px; font-size: 15px;
line-height: 26px; line-height: 26px;
@ -280,7 +273,7 @@ export default {
width: 6px; width: 6px;
height: 6px; height: 6px;
margin-top: 10px; margin-top: 10px;
border: 1px solid @van-doc-dark-grey; border: 1px solid currentColor;
border-radius: 50%; border-radius: 50%;
content: ''; content: '';
} }
@ -310,15 +303,17 @@ export default {
> blockquote { > blockquote {
margin: 16px 0 0; margin: 16px 0 0;
padding: 16px; padding: 16px;
background-color: #ecf9ff; font-size: 14px;
border-radius: @van-doc-border-radius; color: var(--van-doc-blockquote-color);
background-color: var(--van-doc-blockquote-background);
border-radius: var(--van-doc-border-radius);
} }
> img, > img,
> p img { > p img {
width: 100%; width: 100%;
margin: 16px 0; margin: 16px 0;
border-radius: @van-doc-border-radius; border-radius: var(--van-doc-border-radius);
} }
} }
@ -333,7 +328,6 @@ export default {
h1, h1,
h2 { h2 {
color: @van-doc-black;
font-weight: normal; font-weight: normal;
line-height: 1.5; line-height: 1.5;

View File

@ -24,6 +24,16 @@
</a> </a>
</li> </li>
<li v-if="darkModeClass" class="van-doc-header__top-nav-item">
<a
class="van-doc-header__link"
target="_blank"
@click="toggleTheme"
>
<img :src="themeImg" />
</a>
</li>
<li <li
ref="version" ref="version"
v-if="versions" v-if="versions"
@ -69,6 +79,7 @@
<script> <script>
import SearchInput from './SearchInput.vue'; import SearchInput from './SearchInput.vue';
import { packageVersion } from 'site-desktop-shared'; import { packageVersion } from 'site-desktop-shared';
import { getDefaultTheme, syncThemeToChild } from '../../common/iframe-sync';
export default { export default {
name: 'VanDocHeader', name: 'VanDocHeader',
@ -82,10 +93,12 @@ export default {
config: Object, config: Object,
versions: Array, versions: Array,
langConfigs: Array, langConfigs: Array,
darkModeClass: String,
}, },
data() { data() {
return { return {
currentTheme: getDefaultTheme(),
packageVersion, packageVersion,
showVersionPop: false, showVersionPop: false,
}; };
@ -112,9 +125,32 @@ export default {
searchConfig() { searchConfig() {
return this.config.searchConfig; return this.config.searchConfig;
}, },
themeImg() {
if (this.currentTheme === 'light') {
return 'https://b.yzcdn.cn/vant/dark-theme.svg';
}
return 'https://b.yzcdn.cn/vant/light-theme.svg';
},
},
watch: {
currentTheme: {
handler(newVal, oldVal) {
window.localStorage.setItem('vantTheme', newVal);
document.body.classList.remove(`van-doc-theme-${oldVal}`);
document.body.classList.add(`van-doc-theme-${newVal}`);
syncThemeToChild(newVal);
},
immediate: true,
},
}, },
methods: { methods: {
toggleTheme() {
this.currentTheme = this.currentTheme === 'light' ? 'dark' : 'light';
},
toggleVersionPop() { toggleVersionPop() {
const val = !this.showVersionPop; const val = !this.showVersionPop;
@ -147,18 +183,16 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-header { .van-doc-header {
width: 100%; width: 100%;
background-color: #001938; background-color: var(--van-doc-header-background);
user-select: none; user-select: none;
&__top { &__top {
display: flex; display: flex;
align-items: center; align-items: center;
height: @van-doc-header-top-height; height: var(--van-doc-header-top-height);
padding: 0 @van-doc-padding; padding: 0 var(--van-doc-padding);
&-nav { &-nav {
flex: 1; flex: 1;
@ -234,7 +268,7 @@ export default {
transition: 0.2s; transition: 0.2s;
&:hover { &:hover {
color: @van-doc-blue; color: var(--van-doc-link-color);
background-color: #f7f8fa; background-color: #f7f8fa;
} }
} }
@ -268,6 +302,8 @@ export default {
} }
&__link { &__link {
cursor: pointer;
span { span {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;

View File

@ -71,22 +71,19 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-nav { .van-doc-nav {
position: fixed; position: fixed;
left: 0; left: 0;
z-index: 1; z-index: 1;
min-width: @van-doc-nav-width; min-width: var(--van-doc-nav-width);
max-width: @van-doc-nav-width; max-width: var(--van-doc-nav-width);
padding: @van-doc-padding 0; padding: 8px 0;
overflow-y: scroll; overflow-y: scroll;
background-color: #fff; background-color: var(--van-doc-background-2);
box-shadow: 0 8px 12px #ebedf0;
@media (min-width: @van-doc-row-max-width) { @media (min-width: var(--van-doc-row-max-width)) {
left: 50%; left: 50%;
margin-left: -(@van-doc-row-max-width / 2); margin-left: calc((var(--van-doc-row-max-width) / 2 * -1));
} }
&::-webkit-scrollbar { &::-webkit-scrollbar {
@ -110,8 +107,8 @@ export default {
} }
&__title { &__title {
padding: 8px 0 8px @van-doc-padding; padding: 24px 0 0 var(--van-doc-padding);
color: #455a64; color: var(--van-doc-text-color-2);
font-weight: 600; font-weight: 600;
font-size: 15px; font-size: 15px;
line-height: 28px; line-height: 28px;
@ -121,21 +118,19 @@ export default {
a { a {
display: block; display: block;
margin: 8px 0; margin: 8px 0;
padding: 8px 0 8px @van-doc-padding; padding: 6px 0 6px var(--van-doc-padding);
color: #455a64; color: var(--van-doc-text-color-3);
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
transition: color 0.2s; transition: color 0.2s;
&:hover, &:hover,
&.active { &.active {
color: @van-doc-green; color: var(--van-doc-link-color);
} }
&.active { &.active {
font-weight: 600; font-weight: 600;
background-color: #ebfff0;
border-radius: 999px;
} }
span { span {

View File

@ -38,8 +38,6 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
#docsearch { #docsearch {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;

View File

@ -44,34 +44,31 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-simulator { .van-doc-simulator {
position: absolute; position: absolute;
top: @van-doc-padding + @van-doc-header-top-height; top: calc(var(--van-doc-padding) + var(--van-doc-header-top-height));
right: @van-doc-padding; right: var(--van-doc-padding);
z-index: 1; z-index: 1;
box-sizing: border-box; box-sizing: border-box;
width: @van-doc-simulator-width; width: var(--van-doc-simulator-width);
min-width: @van-doc-simulator-width; min-width: var(--van-doc-simulator-width);
overflow: hidden; overflow: hidden;
background: #fafafa; background: var(--van-doc-background-2);
border-radius: @van-doc-border-radius; border-radius: var(--van-doc-border-radius);
box-shadow: 0 8px 12px #ebedf0;
@media (max-width: 1100px) { @media (max-width: 1100px) {
right: auto; right: auto;
left: 750px; left: 750px;
} }
@media (min-width: @van-doc-row-max-width) { @media (min-width: var(--van-doc-row-max-width)) {
right: 50%; right: 50%;
margin-right: -(@van-doc-row-max-width / 2) + 24px; margin-right: calc(var(--van-doc-row-max-width) / 2 * -1 + 24px);
} }
&-fixed { &-fixed {
position: fixed; position: fixed;
top: @van-doc-padding; top: var(--van-doc-padding);
} }
iframe { iframe {

View File

@ -5,6 +5,7 @@
:config="config" :config="config"
:versions="versions" :versions="versions"
:lang-configs="langConfigs" :lang-configs="langConfigs"
:dark-mode-class="darkModeClass"
@switch-version="$emit('switch-version', $event)" @switch-version="$emit('switch-version', $event)"
/> />
<doc-nav :lang="lang" :nav-config="config.nav" /> <doc-nav :lang="lang" :nav-config="config.nav" />
@ -39,8 +40,9 @@ export default {
lang: String, lang: String,
versions: Array, versions: Array,
simulator: String, simulator: String,
hasSimulator: Boolean,
langConfigs: Array, langConfigs: Array,
hasSimulator: Boolean,
darkModeClass: String,
config: { config: {
type: Object, type: Object,
required: true, required: true,
@ -108,7 +110,3 @@ export default {
}, },
}; };
</script> </script>
<style lang="less">
@import '../../common/style/var';
</style>

View File

@ -3,7 +3,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
import { isMobile, decamelize } from '../common'; import { isMobile, decamelize } from '../common';
import { config, documents } from 'site-desktop-shared'; import { config, documents } from 'site-desktop-shared';
import { getLang, setDefaultLang } from '../common/locales'; import { getLang, setDefaultLang } from '../common/locales';
import { listenToSyncPath, syncPathToChild } from '../common/iframe-router'; import { listenToSyncPath, syncPathToChild } from '../common/iframe-sync';
if (isMobile) { if (isMobile) {
location.replace('mobile.html' + location.hash); location.replace('mobile.html' + location.hash);

View File

@ -15,6 +15,9 @@
<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) { %>
<%- headHtml %>
<% } %>
<% if (baiduAnalytics) { %> <% if (baiduAnalytics) { %>
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
@ -27,7 +30,7 @@
</script> </script>
<% } %> <% } %>
</head> </head>
<body ontouchstart> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/desktop/main.js"></script> <script type="module" src="/desktop/main.js"></script>
</body> </body>

View File

@ -15,6 +15,9 @@
<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) { %>
<%- 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>
<script> <script>
@ -36,7 +39,7 @@
</script> </script>
<% } %> <% } %>
</head> </head>
<body ontouchstart> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/mobile/main.js"></script> <script type="module" src="/mobile/main.js"></script>
</body> </body>

View File

@ -10,21 +10,49 @@
</template> </template>
<script> <script>
import { watch } from 'vue';
import DemoNav from './components/DemoNav.vue'; import DemoNav from './components/DemoNav.vue';
import { useCurrentTheme } from '../common/iframe-sync';
import { config } from 'site-mobile-shared';
export default { export default {
components: { DemoNav }, components: { DemoNav },
setup() {
const theme = useCurrentTheme();
watch(
theme,
(newVal, oldVal) => {
document.body.classList.remove(`van-doc-theme-${oldVal}`);
document.body.classList.add(`van-doc-theme-${newVal}`);
const { darkModeClass } = config.site;
if (darkModeClass) {
document.body.classList.toggle(darkModeClass, newVal === 'dark');
}
},
{ immediate: true }
);
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import '../common/style/var';
@import '../common/style/base'; @import '../common/style/base';
body { body {
min-width: 100vw; min-width: 100vw;
} }
.van-doc-theme-light {
background-color: var(--van-doc-gray-1);
}
.van-doc-theme-dark {
background-color: var(--van-doc-black);
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
background: transparent; background: transparent;

View File

@ -20,13 +20,11 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.van-doc-demo-block { .van-doc-demo-block {
&__title { &__title {
margin: 0; margin: 0;
padding: 32px 16px 16px; padding: 32px 16px 16px;
color: @van-doc-text-light-blue; color: var(--van-doc-text-color-4);
font-weight: normal; font-weight: normal;
font-size: 14px; font-size: 14px;
line-height: 16px; line-height: 16px;

View File

@ -52,14 +52,11 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.demo-home { .demo-home {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
padding: 46px 20px 20px; padding: 46px 20px 20px;
background: #fff;
&__title, &__title,
&__desc { &__desc {
@ -94,7 +91,7 @@ export default {
&__desc { &__desc {
margin: 0 0 40px; margin: 0 0 40px;
color: rgba(69, 90, 100, 0.6); color: var(--van-doc-text-color-4);
font-size: 14px; font-size: 14px;
} }
} }

View File

@ -43,12 +43,10 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
@import '../../common/style/var';
.demo-home-nav { .demo-home-nav {
&__title { &__title {
margin: 24px 0 8px 16px; margin: 24px 0 8px 16px;
color: rgba(69, 90, 100, 0.6); color: var(--van-doc-text-color-4);
font-size: 14px; font-size: 14px;
} }
@ -57,20 +55,20 @@ export default {
display: flex; display: flex;
margin: 0 0 12px; margin: 0 0 12px;
padding-left: 20px; padding-left: 20px;
color: #323233; color: var(--van-doc-text-color-3);
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
line-height: 40px; line-height: 40px;
background: #f7f8fa; background-color: var(--van-doc-background-3);
border-radius: 99px; border-radius: 99px;
transition: background 0.3s; transition: opacity 0.3s;
&:hover { &:hover {
background: darken(#f7f8fa, 3%); opacity: 0.8;
} }
&:active { &:active {
background: darken(#f7f8fa, 6%); opacity: 0.6;
} }
} }

View File

@ -42,7 +42,7 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 56px; height: 56px;
background-color: #fff; background-color: var(--van-doc-background-3);
&__title { &__title {
font-weight: 600; font-weight: 600;

View File

@ -13,3 +13,8 @@ window.app = createApp(App)
setTimeout(() => { setTimeout(() => {
window.app.mount('#app'); window.app.mount('#app');
}, 0); }, 0);
// https://stackoverflow.com/questions/3885018/active-pseudo-class-doesnt-work-in-mobile-safari/33681490#33681490
document.addEventListener('touchstart', () => {}, {
passive: true,
});

View File

@ -4,7 +4,7 @@ import DemoHome from './components/DemoHome.vue';
import { decamelize } from '../common'; import { decamelize } from '../common';
import { demos, config } from 'site-mobile-shared'; import { demos, config } from 'site-mobile-shared';
import { getLang, setDefaultLang } from '../common/locales'; import { getLang, setDefaultLang } from '../common/locales';
import { listenToSyncPath, syncPathToParent } from '../common/iframe-router'; import { listenToSyncPath, syncPathToParent } from '../common/iframe-sync';
const { locales, defaultLang } = config.site; const { locales, defaultLang } = config.site;

View File

@ -1,25 +1,26 @@
import { Command } from 'commander'; import { Command } from 'commander';
import { import { cliVersion } from './index.js';
dev,
lint,
test,
clean,
build,
release,
changelog,
buildSite,
commitLint,
cliVersion,
} from './index.js';
const program = new Command(); const program = new Command();
program.version(`@vant/cli ${cliVersion}`); program.version(`@vant/cli ${cliVersion}`);
program.command('dev').description('Run dev server').action(dev); program
.command('dev')
.description('Run dev server')
.action(async () => {
const { dev } = await import('./commands/dev.js');
return dev();
});
program.command('lint').description('Run eslint and stylelint').action(lint); program
.command('lint')
.description('Run ESLint')
.action(async () => {
const { lint } = await import('./commands/lint.js');
return lint();
});
program program
.command('test') .command('test')
@ -45,34 +46,58 @@ program
'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('--debug', 'Print debugging info about your Jest config') .option('--debug', 'Print debugging info about your Jest config')
.action(test); .action(async (options) => {
const { test } = await import('./commands/jest.js');
return test(options);
});
program.command('clean').description('Clean all dist files').action(clean); program
.command('clean')
.description('Clean all dist files')
.action(async () => {
const { clean } = await import('./commands/clean.js');
return clean();
});
program program
.command('build') .command('build')
.description('Compile components in production mode') .description('Compile components in production mode')
.action(build); .action(async () => {
const { build } = await import('./commands/build.js');
return build();
});
program program
.command('release') .command('release')
.description('Compile components and release it') .description('Compile components and release it')
.option('--tag <tag>', 'Release tag') .option('--tag <tag>', 'Release tag')
.action(release); .action(async (options) => {
const { release } = await import('./commands/release.js');
return release(options);
});
program program
.command('build-site') .command('build-site')
.description('Compile site in production mode') .description('Compile site in production mode')
.action(buildSite); .action(async () => {
const { buildSite } = await import('./commands/build-site.js');
return buildSite();
});
program program
.command('changelog') .command('changelog')
.description('Generate changelog') .description('Generate changelog')
.action(changelog); .action(async () => {
const { changelog } = await import('./commands/changelog.js');
return changelog();
});
program program
.command('commit-lint <gitParams>') .command('commit-lint <gitParams>')
.description('Lint commit message') .description('Lint commit message')
.action(commitLint); .action(async (gitParams) => {
const { commitLint } = await import('./commands/commit-lint.js');
return commitLint(gitParams);
});
program.parse(); program.parse();

View File

@ -3,7 +3,7 @@ import execa from 'execa';
import { join, relative } from 'path'; import { join, relative } from '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 { ora, consola } from '../common/logger.js'; import { createSpinner, consola } from '../common/logger.js';
import { installDependencies } from '../common/manager.js'; import { installDependencies } from '../common/manager.js';
import { compileSfc } from '../compiler/compile-sfc.js'; import { compileSfc } from '../compiler/compile-sfc.js';
import { compileStyle } from '../compiler/compile-style.js'; import { compileStyle } from '../compiler/compile-style.js';
@ -12,9 +12,9 @@ import { compileBundles } from '../compiler/compile-bundles.js';
import { genPackageEntry } from '../compiler/gen-package-entry.js'; import { genPackageEntry } from '../compiler/gen-package-entry.js';
import { genStyleDepsMap } from '../compiler/gen-style-deps-map.js'; import { genStyleDepsMap } from '../compiler/gen-style-deps-map.js';
import { genComponentStyle } from '../compiler/gen-component-style.js'; import { genComponentStyle } from '../compiler/gen-component-style.js';
import { SRC_DIR, LIB_DIR, ES_DIR } from '../common/constant.js'; import { SRC_DIR, LIB_DIR, ES_DIR, getVantConfig } from '../common/constant.js';
import { genPackageStyle } from '../compiler/gen-package-style.js'; import { genPackageStyle } from '../compiler/gen-package-style.js';
import { genVeturConfig } from '../compiler/gen-vetur-config.js'; import { genWebStormTypes } from '../compiler/web-types/index.js';
import { import {
isDir, isDir,
isSfc, isSfc,
@ -135,9 +135,10 @@ async function buildPackageStyleEntry() {
} }
async function buildBundledOutputs() { async function buildBundledOutputs() {
const config = getVantConfig();
setModuleEnv('esmodule'); setModuleEnv('esmodule');
await compileBundles(); await compileBundles();
genVeturConfig(); genWebStormTypes(config.build?.tagPrefix);
} }
const tasks = [ const tasks = [
@ -178,14 +179,14 @@ const tasks = [
async function runBuildTasks() { async function runBuildTasks() {
for (let i = 0; i < tasks.length; i++) { for (let i = 0; i < tasks.length; i++) {
const { task, text } = tasks[i]; const { task, text } = tasks[i];
const spinner = ora(text).start(); const spinner = createSpinner(text).start();
try { try {
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
await task(); await task();
spinner.succeed(text); spinner.success({ text });
} catch (err) { } catch (err) {
spinner.fail(text); spinner.error({ text });
console.log(err); console.log(err);
throw err; throw err;
} }

View File

@ -1,7 +1,7 @@
import { join, dirname } from 'path'; import { join, dirname } from 'path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
import { ROOT } from '../common/constant.js'; import { ROOT } from '../common/constant.js';
import { ora, slimPath } from '../common/logger.js'; import { createSpinner, slimPath } from '../common/logger.js';
import { createWriteStream, readFileSync } from 'fs'; import { createWriteStream, readFileSync } from 'fs';
import conventionalChangelog from 'conventional-changelog'; import conventionalChangelog from 'conventional-changelog';
@ -48,7 +48,7 @@ function transform(item: any) {
} }
export async function changelog(): Promise<void> { export async function changelog(): Promise<void> {
const spinner = ora('Generating changelog...').start(); const spinner = createSpinner('Generating changelog...').start();
return new Promise((resolve) => { return new Promise((resolve) => {
conventionalChangelog( conventionalChangelog(
@ -68,7 +68,9 @@ export async function changelog(): Promise<void> {
) )
.pipe(createWriteStream(DIST_FILE)) .pipe(createWriteStream(DIST_FILE))
.on('close', () => { .on('close', () => {
spinner.succeed(`Changelog generated at ${slimPath(DIST_FILE)}`); spinner.success({
text: `Changelog generated at ${slimPath(DIST_FILE)}`,
});
resolve(); resolve();
}); });
}); });

View File

@ -3,7 +3,6 @@ import {
ES_DIR, ES_DIR,
LIB_DIR, LIB_DIR,
DIST_DIR, DIST_DIR,
VETUR_DIR,
SITE_DIST_DIR, SITE_DIST_DIR,
} from '../common/constant.js'; } from '../common/constant.js';
@ -14,7 +13,6 @@ export async function clean() {
remove(ES_DIR), remove(ES_DIR),
remove(LIB_DIR), remove(LIB_DIR),
remove(DIST_DIR), remove(DIST_DIR),
remove(VETUR_DIR),
remove(SITE_DIST_DIR), remove(SITE_DIST_DIR),
]); ]);
} }

View File

@ -1,5 +1,5 @@
import execa from 'execa'; import execa from 'execa';
import { consola, ora } 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';
type RunCommandMessages = { type RunCommandMessages = {
@ -13,7 +13,7 @@ function runCommand(
options: string[], options: string[],
messages: RunCommandMessages messages: RunCommandMessages
) { ) {
const spinner = ora(messages.start).start(); const spinner = createSpinner(messages.start).start();
return new Promise((resolve) => { return new Promise((resolve) => {
execa(cmd, options, { execa(cmd, options, {
@ -21,11 +21,11 @@ function runCommand(
env: { FORCE_COLOR: true }, env: { FORCE_COLOR: true },
}) })
.then(() => { .then(() => {
spinner.succeed(messages.succeed); spinner.success({ text: messages.succeed });
resolve(true); resolve(true);
}) })
.catch((err: any) => { .catch((err: any) => {
spinner.fail(messages.failed); spinner.error({ text: messages.failed });
consola.error(err.stderr || err.stdout); consola.error(err.stderr || err.stdout);
resolve(false); resolve(false);
}); });
@ -44,23 +44,10 @@ function eslint() {
); );
} }
function stylelint() {
return runCommand(
'stylelint',
['src/**/*.css', 'src/**/*.vue', 'src/**/*.less', 'src/**/*.sass', '--fix'],
{
start: 'Running stylelint...',
succeed: 'Stylelint Passed.',
failed: 'Stylelint failed!',
}
);
}
export async function lint() { export async function lint() {
const eslintPassed = await eslint(); const eslintPassed = await eslint();
const stylelintPassed = await stylelint();
if (!eslintPassed || !stylelintPassed) { if (!eslintPassed) {
process.exit(1); process.exit(1);
} }
} }

View File

@ -4,7 +4,7 @@ import { join, dirname } from 'path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
const PLUGIN_PATH = join(__dirname, '../../cjs/vant-cli-release-plugin.cjs'); const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js');
export async function release(command: { tag?: string }) { export async function release(command: { tag?: string }) {
await releaseIt({ await releaseIt({

View File

@ -21,7 +21,6 @@ export const ROOT = findRootDir(CWD);
export const ES_DIR = join(ROOT, 'es'); export const ES_DIR = join(ROOT, 'es');
export const LIB_DIR = join(ROOT, 'lib'); export const LIB_DIR = join(ROOT, 'lib');
export const DOCS_DIR = join(ROOT, 'docs'); export const DOCS_DIR = join(ROOT, 'docs');
export const VETUR_DIR = join(ROOT, 'vetur');
export const SITE_DIST_DIR = join(ROOT, 'site-dist'); export const SITE_DIST_DIR = join(ROOT, 'site-dist');
export const VANT_CONFIG_FILE = join(ROOT, 'vant.config.mjs'); export const VANT_CONFIG_FILE = join(ROOT, 'vant.config.mjs');
export const PACKAGE_JSON_FILE = join(ROOT, 'package.json'); export const PACKAGE_JSON_FILE = join(ROOT, 'package.json');

View File

@ -1,10 +1,10 @@
import ora from 'ora'; import { createSpinner } from 'nanospinner';
import chalk from 'chalk'; 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) {
return chalk.yellow(path.replace(ROOT, '')); return color.yellow(path.replace(ROOT, ''));
} }
export { ora, consola }; export { createSpinner, consola };

View File

@ -1,68 +1,41 @@
import fse from 'fs-extra';
import { join } from 'path';
import { build } from 'vite'; import { build } from 'vite';
import { getPackageJson, getVantConfig, LIB_DIR } from '../common/constant.js'; import { getPackageJson, getVantConfig } from '../common/constant.js';
import { mergeCustomViteConfig } from '../common/index.js'; import { mergeCustomViteConfig } from '../common/index.js';
import { getViteConfigForPackage } from '../config/vite.package.js'; import { getViteConfigForPackage } from '../config/vite.package.js';
import type { LibraryFormats } from 'vite';
// generate entry file for nuxt export type BundleOption = {
async function genEntryForSSR() { minify?: boolean;
const { name } = getVantConfig(); formats: LibraryFormats[];
const cjsPath = join(LIB_DIR, 'ssr.js'); external?: string[];
const mjsPath = join(LIB_DIR, 'ssr.mjs');
const cjsContent = `'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./${name}.cjs.min.js');
} else {
module.exports = require('./${name}.cjs.js');
}; };
`;
const mjsContent = `export * from './index.js';\n`;
return Promise.all([
fse.outputFile(cjsPath, cjsContent),
fse.outputFile(mjsPath, mjsContent),
]);
}
export async function compileBundles() { export async function compileBundles() {
const dependencies = getPackageJson().dependencies || {}; const dependencies = getPackageJson().dependencies || {};
const externals = Object.keys(dependencies); const external = Object.keys(dependencies);
const configs = [ const DEFAULT_OPTIONS: BundleOption[] = [
// umd bundle {
getViteConfigForPackage({
minify: false, minify: false,
formats: ['umd'], formats: ['umd'],
external: ['vue'], },
}), {
// umd bundle (minified)
getViteConfigForPackage({
minify: true, minify: true,
formats: ['umd'], formats: ['umd'],
external: ['vue'], },
}), {
// esm/cjs bundle
getViteConfigForPackage({
minify: false, minify: false,
formats: ['es', 'cjs'], formats: ['es', 'cjs'],
external: ['vue', ...externals], external,
}), },
// esm/cjs bundle (minified)
// vite will not minify es bundle
// see: https://github.com/vuejs/vue-next/issues/2860
getViteConfigForPackage({
minify: true,
formats: ['es', 'cjs'],
external: ['vue', ...externals],
}),
]; ];
const bundleOptions: BundleOption[] =
getVantConfig().build?.bundleOptions || DEFAULT_OPTIONS;
await Promise.all( await Promise.all(
configs.map((config) => build(mergeCustomViteConfig(config))) bundleOptions.map((config) =>
build(mergeCustomViteConfig(getViteConfigForPackage(config)))
)
); );
await genEntryForSSR();
} }

View File

@ -87,15 +87,13 @@ export async function compileSfc(filePath: string): Promise<any> {
new Promise((resolve) => { new Promise((resolve) => {
let script = ''; let script = '';
// the generated render fn lacks type definitions let bindingMetadata;
if (lang === 'ts') {
script += '// @ts-nocheck\n';
}
if (descriptor.scriptSetup) { if (descriptor.scriptSetup) {
script += compileScript(descriptor, { const { bindings, content } = compileScript(descriptor, {
id: scopeId, id: scopeId,
}).content; });
script += content;
bindingMetadata = bindings;
} else { } else {
script += descriptor.script!.content; script += descriptor.script!.content;
} }
@ -108,6 +106,9 @@ export async function compileSfc(filePath: string): Promise<any> {
id: scopeId, id: scopeId,
source: template.content, source: template.content,
filename: filePath, filename: filePath,
compilerOptions: {
bindingMetadata,
},
}).code; }).code;
script = injectRender(script, render); script = injectRender(script, render);
@ -119,6 +120,12 @@ export async function compileSfc(filePath: string): Promise<any> {
script += `\n${EXPORT} ${VUEIDS}`; script += `\n${EXPORT} ${VUEIDS}`;
// ts-nocheck should be placed on the first line
// the generated render fn lacks type definitions
if (lang === 'ts') {
script = '// @ts-nocheck\n' + script;
}
outputFile(scriptFilePath, script).then(resolve); outputFile(scriptFilePath, script).then(resolve);
}) })
); );

View File

@ -1,4 +1,4 @@
import chalk from 'chalk'; import color from 'picocolors';
import { createRequire } from 'module'; import { createRequire } from 'module';
import { createServer, build } from 'vite'; import { createServer, build } from 'vite';
import { import {
@ -38,8 +38,8 @@ export async function compileSite(production = false) {
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
const { version } = require('vite/package.json'); const { version } = require('vite/package.json');
const viteInfo = chalk.cyan(`vite v${version}`); const viteInfo = color.cyan(`vite v${version}`);
console.log(`\n ${viteInfo}` + chalk.green(` dev server running at:\n`)); console.log(`\n ${viteInfo}` + color.green(` dev server running at:\n`));
server.printUrls(); server.printUrls();
} }
} }

View File

@ -1,11 +1,13 @@
import { parse } from 'path'; import { parse } from 'path';
import { readFileSync, writeFileSync } from 'fs'; import fse from 'fs-extra';
import { replaceExt } from '../common/index.js'; import { getVantConfig, replaceExt } from '../common/index.js';
import { compileCss } from './compile-css.js'; import { compileCss } from './compile-css.js';
import { compileLess } from './compile-less.js'; import { compileLess } from './compile-less.js';
import { compileSass } from './compile-sass.js'; import { compileSass } from './compile-sass.js';
import { consola } from '../common/logger.js'; import { consola } from '../common/logger.js';
const { readFileSync, writeFileSync, removeSync } = fse;
async function compileFile(filePath: string) { async function compileFile(filePath: string) {
const parsedPath = parse(filePath); const parsedPath = parse(filePath);
@ -30,6 +32,11 @@ async function compileFile(filePath: string) {
export async function compileStyle(filePath: string) { export async function compileStyle(filePath: string) {
const css = await compileFile(filePath); const css = await compileFile(filePath);
const vantConfig = getVantConfig();
if (vantConfig.build?.css?.removeSourceFile) {
removeSync(filePath);
}
writeFileSync(replaceExt(filePath, '.css'), css); writeFileSync(replaceExt(filePath, '.css'), css);
} }

View File

@ -12,6 +12,7 @@ import {
ES_DIR, ES_DIR,
SRC_DIR, SRC_DIR,
LIB_DIR, LIB_DIR,
getVantConfig,
STYLE_DEPS_JSON_FILE, STYLE_DEPS_JSON_FILE,
} from '../common/constant.js'; } from '../common/constant.js';
@ -87,8 +88,10 @@ export function genComponentStyle(
delete require.cache[STYLE_DEPS_JSON_FILE]; delete require.cache[STYLE_DEPS_JSON_FILE];
} }
const vantConfig = getVantConfig();
const components = getComponents(); const components = getComponents();
const baseFile = getCssBaseFile(); const baseFile = getCssBaseFile();
const hasSourceFile = vantConfig.build?.css?.removeSourceFile !== true;
components.forEach((component) => { components.forEach((component) => {
genEntry({ genEntry({
@ -98,7 +101,7 @@ export function genComponentStyle(
ext: '.css', ext: '.css',
}); });
if (CSS_LANG !== 'css') { if (CSS_LANG !== 'css' && hasSourceFile) {
genEntry({ genEntry({
baseFile, baseFile,
component, component,

View File

@ -1,25 +0,0 @@
import markdownVetur from '@vant/markdown-vetur';
import {
SRC_DIR,
VETUR_DIR,
getVantConfig,
getPackageJson,
} from '../common/constant.js';
// generate vetur tags & attributes
export function genVeturConfig() {
const pkgJson = getPackageJson();
const vantConfig = getVantConfig();
const options = vantConfig.build?.vetur;
if (options) {
markdownVetur.parseAndWrite({
name: vantConfig.name,
path: SRC_DIR,
test: /README\.md/,
version: pkgJson.version,
outputDir: VETUR_DIR,
...options,
});
}
}

View File

@ -1,7 +1,7 @@
const releaseIt = require('release-it'); import { Plugin } from 'release-it';
const { execSync } = require('child_process'); import { execSync } from 'child_process';
class VantCliReleasePlugin extends releaseIt.Plugin { class VantCliReleasePlugin extends Plugin {
async beforeRelease() { async beforeRelease() {
// log an empty line // log an empty line
console.log(''); console.log('');
@ -11,4 +11,4 @@ class VantCliReleasePlugin extends releaseIt.Plugin {
} }
} }
module.exports = VantCliReleasePlugin; export default VantCliReleasePlugin;

View File

@ -1,14 +1,19 @@
/* eslint-disable no-continue */ /* eslint-disable no-continue */
import { Articals } from './parser'; import { Articles } from './parser.js';
import { formatOptions, formatType, removeVersion, toKebabCase } from './utils'; import {
import { VueEventArgument, VueTag } from './type'; formatOptions,
formatType,
removeVersion,
toKebabCase,
} from './utils.js';
import { VueEventArgument, VueTag } from './type.js';
function formatComponentName(name: string, tagPrefix: string) { function formatComponentName(name: string, tagPrefix: string) {
return tagPrefix + toKebabCase(name); return tagPrefix + toKebabCase(name);
} }
/** /**
* format arugments of events * format arguments of events
* input = value: { foo: foo or 1, bar: bar or 2 }, value2: { one: 1 and 1, two: 2 and 2 }, foo: bar * input = value: { foo: foo or 1, bar: bar or 2 }, value2: { one: 1 and 1, two: 2 and 2 }, foo: bar
* output = [{ name: 'value', type: '{ foo: foo or 1, bar: bar or 2 }' }, { name: 'value2', type: '{ one: 1 and 1, two: 2 and 2 }'}, { name: 'foo', type: 'bar' }] * output = [{ name: 'value', type: '{ foo: foo or 1, bar: bar or 2 }' }, { name: 'value2', type: '{ one: 1 and 1, two: 2 and 2 }'}, { name: 'foo', type: 'bar' }]
*/ */
@ -73,29 +78,29 @@ function findTag(vueTags: VueTag[], name: string) {
export function formatter( export function formatter(
vueTags: VueTag[], vueTags: VueTag[],
articals: Articals, articles: Articles,
tagPrefix = '' tagPrefix = ''
) { ) {
if (!articals.length) { if (!articles.length) {
return; return;
} }
const mainTitle = articals[0].content; const mainTitle = articles[0].content;
const defaultName = mainTitle const defaultName = mainTitle
? formatComponentName(mainTitle.split(' ')[0], tagPrefix) ? formatComponentName(mainTitle.split(' ')[0], tagPrefix)
: ''; : '';
const tables = articals.filter((artical) => artical.type === 'table'); const tables = articles.filter((article) => article.type === 'table');
tables.forEach((item) => { tables.forEach((item) => {
const { table } = item; const { table } = item;
const prevIndex = articals.indexOf(item) - 1; const prevIndex = articles.indexOf(item) - 1;
const prevArtical = articals[prevIndex]; const prevArticle = articles[prevIndex];
if (!prevArtical || !prevArtical.content || !table || !table.body) { if (!prevArticle || !prevArticle.content || !table || !table.body) {
return; return;
} }
const tableTitle = prevArtical.content; const tableTitle = prevArticle.content;
if (tableTitle.includes('Props')) { if (tableTitle.includes('Props')) {
const name = getNameFromTableTitle(tableTitle, tagPrefix) || defaultName; const name = getNameFromTableTitle(tableTitle, tagPrefix) || defaultName;

View File

@ -0,0 +1,55 @@
import glob from 'fast-glob';
import { join } from 'path';
import fse from 'fs-extra';
import { mdParser } from './parser.js';
import { formatter } from './formatter.js';
import { genWebTypes } from './web-types.js';
import { Options, VueTag } from './type.js';
import { normalizePath } from './utils.js';
import {
SRC_DIR,
LIB_DIR,
getVantConfig,
getPackageJson,
} from '../../common/constant.js';
async function readMarkdown(options: Options) {
const mds = await glob(normalizePath(`${options.path}/**/*.md`));
return mds
.filter((md) => options.test.test(md))
.map((path) => fse.readFileSync(path, 'utf-8'));
}
export async function parseAndWrite(options: Options) {
if (!options.outputDir) {
throw new Error('outputDir can not be empty.');
}
const mds = await readMarkdown(options);
const vueTags: VueTag[] = [];
mds.forEach((md) => {
const parsedMd = mdParser(md);
formatter(vueTags, parsedMd, options.tagPrefix);
});
const webTypes = genWebTypes(vueTags, options);
fse.outputFileSync(
join(options.outputDir, 'web-types.json'),
JSON.stringify(webTypes, null, 2)
);
}
export function genWebStormTypes(tagPrefix?: string) {
const pkgJson = getPackageJson();
const vantConfig = getVantConfig();
parseAndWrite({
name: vantConfig.name,
path: SRC_DIR,
test: /README\.md/,
version: pkgJson.version,
outputDir: LIB_DIR,
tagPrefix,
});
}

View File

@ -9,14 +9,14 @@ type TableContent = {
body: string[][]; body: string[][];
}; };
export type Artical = { export type Article = {
type: string; type: string;
content?: string; content?: string;
table?: TableContent; table?: TableContent;
level?: number; level?: number;
}; };
export type Articals = Artical[]; export type Articles = Article[];
function readLine(input: string) { function readLine(input: string) {
const end = input.indexOf('\n'); const end = input.indexOf('\n');
@ -75,8 +75,8 @@ function tableParse(input: string) {
}; };
} }
export function mdParser(input: string): Articals { export function mdParser(input: string): Articles {
const artical = []; const article = [];
let start = 0; let start = 0;
const end = input.length; const end = input.length;
@ -85,7 +85,7 @@ export function mdParser(input: string): Articals {
let match; let match;
if ((match = TITLE_REG.exec(target))) { if ((match = TITLE_REG.exec(target))) {
artical.push({ article.push({
type: 'title', type: 'title',
content: match[2], content: match[2],
level: match[1].length, level: match[1].length,
@ -94,7 +94,7 @@ export function mdParser(input: string): Articals {
start += match.index + match[0].length; start += match.index + match[0].length;
} else if ((match = TABLE_REG.exec(target))) { } else if ((match = TABLE_REG.exec(target))) {
const { table, usedLength } = tableParse(target.substr(match.index)); const { table, usedLength } = tableParse(target.substr(match.index));
artical.push({ article.push({
type: 'table', type: 'table',
table, table,
}); });
@ -105,5 +105,5 @@ export function mdParser(input: string): Articals {
} }
} }
return artical; return article;
} }

View File

@ -35,26 +35,6 @@ export type VueTag = {
description?: string; description?: string;
}; };
export type VeturTag = {
description?: string;
attributes: string[];
};
export type VeturTags = Record<string, VeturTag>;
export type VeturAttribute = {
type: string;
description: string;
options?: string[];
};
export type VeturAttributes = Record<string, VeturAttribute>;
export type VeturResult = {
tags: VeturTags;
attributes: VeturAttributes;
};
export type Options = { export type Options = {
name: string; name: string;
path: PathLike; path: PathLike;

View File

@ -1,4 +1,4 @@
import { VueTag, Options } from './type'; import type { VueTag, Options } from './type.js';
// create web-types.json to provide autocomplete in JetBrains IDEs // create web-types.json to provide autocomplete in JetBrains IDEs
export function genWebTypes(tags: VueTag[], options: Options) { export function genWebTypes(tags: VueTag[], options: Options) {

View File

@ -1,28 +1,32 @@
import { join } from 'path'; import { join } from '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, LibraryFormats } from 'vite'; import type { InlineConfig } from 'vite';
import type { BundleOption } from '../compiler/compile-bundles.js';
export function getViteConfigForPackage({ export function getViteConfigForPackage({
minify, minify,
formats, formats,
external, external = [],
}: { }: BundleOption): InlineConfig {
minify: boolean;
formats: LibraryFormats[];
external: string[];
}): InlineConfig {
setBuildTarget('package'); setBuildTarget('package');
const { name, build } = getVantConfig(); const { name, build } = getVantConfig();
const entryExtension = build?.extensions?.esm || '.js'; const entryExtension = build?.extensions?.esm || '.js';
const entry = join(ES_DIR, `index${entryExtension}`); const entry = join(ES_DIR, `index${entryExtension}`);
const shouldReplaceEnv = minify || formats?.includes('umd');
return { return {
root: CWD, root: CWD,
logLevel: 'silent', logLevel: 'silent',
define: shouldReplaceEnv
? {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}
: undefined,
build: { build: {
lib: { lib: {
name, name,
@ -33,10 +37,11 @@ export function getViteConfigForPackage({
return minify ? `${name}${suffix}.min.js` : `${name}${suffix}.js`; return minify ? `${name}${suffix}.min.js` : `${name}${suffix}.js`;
}, },
}, },
// terser has better compression than esbuild // terser has better compression than esbuild
minify: minify ? 'terser' : false, minify: minify ? 'terser' : false,
rollupOptions: { rollupOptions: {
external, external: [...external, 'vue'],
output: { output: {
dir: LIB_DIR, dir: LIB_DIR,
exports: 'named', exports: 'named',

View File

@ -137,6 +137,7 @@ export function getViteConfigForSiteDev(): InlineConfig {
const vantConfig = getVantConfig(); const vantConfig = getVantConfig();
const siteConfig = getSiteConfig(vantConfig); const siteConfig = getSiteConfig(vantConfig);
const title = getTitle(siteConfig); const title = getTitle(siteConfig);
const headHtml = vantConfig.site?.headHtml;
const baiduAnalytics = vantConfig.site?.baiduAnalytics; const baiduAnalytics = vantConfig.site?.baiduAnalytics;
const enableVConsole = isDev() && vantConfig.site?.enableVConsole; const enableVConsole = isDev() && vantConfig.site?.enableVConsole;
@ -178,6 +179,7 @@ export function getViteConfigForSiteDev(): InlineConfig {
// `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,
baiduAnalytics, baiduAnalytics,
enableVConsole, enableVConsole,
meta: getHTMLMeta(vantConfig), meta: getHTMLMeta(vantConfig),
@ -202,9 +204,9 @@ export function getViteConfigForSiteProd(): InlineConfig {
base: publicPath, base: publicPath,
build: { build: {
outDir, outDir,
brotliSize: false, reportCompressedSize: false,
emptyOutDir: true, emptyOutDir: true,
// https://github.com/youzan/vant/issues/9703 // https://github.com/vant-ui/vant/issues/9703
cssTarget: ['chrome53'], cssTarget: ['chrome53'],
rollupOptions: { rollupOptions: {
input: { input: {

View File

@ -1,30 +1,9 @@
// @ts-ignore // @ts-ignore
import fs from 'fs'; import fs from 'fs';
import { URL, fileURLToPath } from 'url'; import { URL, fileURLToPath } from 'url';
import { dev } from './commands/dev.js';
import { lint } from './commands/lint.js';
import { test } from './commands/jest.js';
import { clean } from './commands/clean.js';
import { build } from './commands/build.js';
import { release } from './commands/release.js';
import { changelog } from './commands/changelog.js';
import { buildSite } from './commands/build-site.js';
import { commitLint } from './commands/commit-lint.js';
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'));
export const cliVersion: string = packageJson.version; export const cliVersion: string = packageJson.version;
process.env.VANT_CLI_VERSION = cliVersion; process.env.VANT_CLI_VERSION = cliVersion;
export {
dev,
lint,
test,
clean,
build,
release,
changelog,
buildSite,
commitLint,
};

View File

@ -4,4 +4,3 @@ declare module 'hash-sum';
declare module '@babel/core'; declare module '@babel/core';
declare module 'release-it'; declare module 'release-it';
declare module 'conventional-changelog'; declare module 'conventional-changelog';
declare module '@vant/markdown-vetur';

View File

@ -0,0 +1,10 @@
MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,32 @@
# @vant/compat
This package provides Vant 3 compatible behavior for Vant 4 users.
## Install
```shell
# with npm
npm i @vant/compat
# with yarn
yarn add @vant/compat
# with pnpm
pnpm add @vant/compat
```
## Usage
```js
// Same as Toast in Vant 3
import { Toast } from '@vant/compat';
// Same as Dialog in Vant 3
import { Dialog } from '@vant/compat';
// Same as Notify in Vant 3
import { Notify } from '@vant/compat';
// Same as ImagePreview in Vant 3
import { ImagePreview } from '@vant/compat';
```

View File

@ -0,0 +1 @@
require('../vant-use/build');

View File

@ -0,0 +1,52 @@
{
"name": "@vant/compat",
"version": "1.0.0",
"description": "Provide Vant 3 compatible behavior for Vant 4",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.esm.mjs",
"require": "./dist/index.cjs.js"
}
},
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"clean": "rimraf ./dist",
"dev": "node ./build.js -w",
"build:types": "tsc -p ./tsconfig.json --emitDeclarationOnly",
"build:bundle": "node ./build.js",
"build": "pnpm clean && pnpm build:bundle && pnpm build:types",
"release": "pnpm build && release-it"
},
"repository": {
"type": "git",
"url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-compat"
},
"bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan",
"license": "MIT",
"devDependencies": {
"@vue/runtime-core": "^3.2.27",
"vant": "workspace:*",
"vue": "^3.2.27",
"esbuild": "^0.14.29",
"release-it": "^15.1.1",
"typescript": "^4.7.4"
},
"release-it": {
"git": {
"tag": false,
"commitMessage": "release: @vant/compat ${version}"
}
}
}

View File

@ -0,0 +1,30 @@
import {
Dialog as VanDialog,
showDialog,
closeDialog,
showConfirmDialog,
setDialogDefaultOptions,
resetDialogDefaultOptions,
} from 'vant';
import type { App } from 'vue';
export const Dialog = (...args: Parameters<typeof showDialog>) =>
showDialog(...args);
Dialog.Component = VanDialog;
Dialog.alert = Dialog;
Dialog.config = showConfirmDialog;
Dialog.close = closeDialog;
Dialog.setDefaultOptions = setDialogDefaultOptions;
Dialog.resetDefaultOptions = resetDialogDefaultOptions;
Dialog.install = (app: App) => {
app.use(Dialog.Component);
app.config.globalProperties.$dialog = Dialog;
};
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$dialog: typeof Dialog;
}
}

View File

@ -0,0 +1,11 @@
import { ImagePreview as VanImagePreview, showImagePreview } from 'vant';
import type { App } from 'vue';
export const ImagePreview = (...args: Parameters<typeof showImagePreview>) =>
showImagePreview(...args);
ImagePreview.Component = VanImagePreview;
ImagePreview.install = (app: App) => {
app.use(ImagePreview.Component);
};

View File

@ -0,0 +1,4 @@
export * from './toast';
export * from './notify';
export * from './dialog';
export * from './image-preview';

View File

@ -0,0 +1,27 @@
import {
Notify as VanNotify,
showNotify,
closeNotify,
setNotifyDefaultOptions,
resetNotifyDefaultOptions,
} from 'vant';
import type { App } from 'vue';
export const Notify = (...args: Parameters<typeof showNotify>) =>
showNotify(...args);
Notify.clear = closeNotify;
Notify.Component = VanNotify;
Notify.setDefaultOptions = setNotifyDefaultOptions;
Notify.resetDefaultOptions = resetNotifyDefaultOptions;
Notify.install = (app: App) => {
app.use(Notify.Component);
app.config.globalProperties.$notify = Notify;
};
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$notify: typeof Notify;
}
}

View File

@ -0,0 +1,49 @@
import {
showToast,
closeToast,
showFailToast,
showSuccessToast,
allowMultipleToast,
setToastDefaultOptions,
resetToastDefaultOptions,
} from 'vant';
import type { App } from 'vue';
export const Toast = (...args: Parameters<typeof showToast>) => {
const toast = showToast(...args);
return {
clear: toast.close,
...toast,
};
};
Toast.fail = (...args: Parameters<typeof showFailToast>) => {
const toast = showFailToast(...args);
return {
clear: toast.close,
...toast,
};
};
Toast.success = (...args: Parameters<typeof showSuccessToast>) => {
const toast = showSuccessToast(...args);
return {
clear: toast.close,
...toast,
};
};
Toast.clear = closeToast;
Toast.allowMultiple = allowMultipleToast;
Toast.setDefaultOptions = setToastDefaultOptions;
Toast.resetDefaultOptions = resetToastDefaultOptions;
Toast.install = (app: App) => {
app.config.globalProperties.$toast = Toast;
};
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$toast: typeof Toast;
}
}

View File

@ -1,9 +1,7 @@
{ {
"extends": "../../tsconfig", "extends": "../../tsconfig",
"compilerOptions": { "compilerOptions": {
"target": "ES2019", "outDir": "./dist",
"outDir": "./lib",
"module": "commonjs",
"declaration": true "declaration": true
}, },
"include": ["src/**/*"] "include": ["src/**/*"]

View File

@ -0,0 +1,10 @@
MIT License
Copyright (c) Youzan
Copyright (c) Chen Jiahan and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/eslint-config", "name": "@vant/eslint-config",
"version": "3.4.0", "version": "3.5.0",
"description": "eslint config of vant", "description": "eslint config of vant",
"main": "index.js", "main": "index.js",
"publishConfig": { "publishConfig": {
@ -13,24 +13,24 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/youzan/vant.git", "url": "https://github.com/vant-ui/vant.git",
"directory": "packages/vant-eslint-config" "directory": "packages/vant-eslint-config"
}, },
"bugs": "https://github.com/youzan/vant/issues", "bugs": "https://github.com/vant-ui/vant/issues",
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "^5.10.0", "@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.10.0", "@typescript-eslint/parser": "^5.36.1",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-vue": "^8.4.0" "eslint-plugin-vue": "^9.4.0"
}, },
"devDependencies": { "devDependencies": {
"enhanced-resolve": "^5.8.3", "enhanced-resolve": "^5.10.0",
"eslint": "^8.7.0", "eslint": "^8.23.0",
"typescript": "~4.5.5" "typescript": "^4.8.2"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^7.32.0 || ^8.2.0" "eslint": "^7.32.0 || ^8.2.0"

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