diff --git a/.editorconfig b/.editorconfig index 39cb692c8..e717f5eb6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,9 @@ +# http://editorconfig.org root = true [*] indent_style = space +indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true @@ -9,15 +11,3 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false - -[*.js] -indent_size = 2 - -[*.vue] -indent_size = 2 - -[*.css] -indent_size = 2 - -[Makefile] -indent_style = tab diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cc194f37c..818daeeac 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -38,8 +38,12 @@ npm run dev # open http://localhost:8080 ``` -## Contribute from the browser with a single click +## Contribute online with a single click -You can use gitpod (A free online IDE) with a single click it will launch a ready to code workspace with dependencies pre-installed and the web server running so that you don't have to waste any time on the dev setup and start contributing straight away. +You can use Gitpod (A free online VS Code-like IDE) for contributing, With a single click it will launch a workspace and automatically: + +- clone the vant repo. +- run `npm run bootstrap`. +- run `npm run dev`. [](https://gitpod.io/#https://github.com/youzan/vant) diff --git a/.ls-lint.yml b/.ls-lint.yml new file mode 100644 index 000000000..e68cab8bf --- /dev/null +++ b/.ls-lint.yml @@ -0,0 +1,14 @@ +ls: + src/**: + .js: kebab-case | PascalCase + .ts: kebab-case | PascalCase + .tsx: kebab-case | PascalCase + .vue: kebab-case | PascalCase + .less: kebab-case + .spec.js: kebab-case + + types: + .d.ts: kebab-case + +ignore: + - src/locale/lang diff --git a/README.md b/README.md index 2f9ab08a5..e68ca30a5 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,13 @@
🔥 文档网站 + + 💡 国内镜像文档 + + 🇨🇳 中文版介绍 + 🚀 小程序版
@@ -24,14 +29,14 @@ ## Features -* 60+ Reusable components -* 90% Unit test coverage -* Extensive documentation and demos -* Support [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) -* Support Custom Theme -* Support i18n -* Support TS -* Support SSR +- 60+ Reusable components +- 90% Unit test coverage +- Extensive documentation and demos +- Support [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) +- Support Custom Theme +- Support i18n +- Support TS +- Support SSR ## Install @@ -66,17 +71,17 @@ Modern browsers and Android 4.0+, iOS 8.0+. ## Ecosystem | Project | Description | -|-----|------| +| --- | --- | | [vant-demo](https://github.com/youzan/vant-demo) | Official vant demo collection | -| [vant-weapp](https://github.com/youzan/vant-weapp) | WeChat MiniProgram UI | +| [vant-weapp](https://github.com/youzan/vant-weapp) | WeChat MiniProgram UI | | [vant-cli](https://github.com/youzan/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-touch-emulator](https://github.com/youzan/vant/tree/dev/packages/vant-touch-emulator) | Using vant in desktop browsers | ## Links -* [Documentation](https://youzan.github.io/vant) -* [Changelog](https://youzan.github.io/vant#/en-US/changelog) +- [Documentation](https://youzan.github.io/vant) +- [Changelog](https://youzan.github.io/vant#/en-US/changelog) ## Preview diff --git a/README.zh-CN.md b/README.zh-CN.md index e0a8e121e..8b4179d5f 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -14,6 +14,10 @@🔥 文档网站 + + 💡 国内镜像文档 + + 🚀 小程序版
@@ -21,14 +25,14 @@ ## 特性 -* 60+ 高质量组件 -* 90% 单元测试覆盖率 -* 完善的中英文文档和示例 -* 支持按需引入 -* 支持主题定制 -* 支持国际化 -* 支持 TS -* 支持 SSR +- 60+ 高质量组件 +- 90% 单元测试覆盖率 +- 完善的中英文文档和示例 +- 支持按需引入 +- 支持主题定制 +- 支持国际化 +- 支持 TS +- 支持 SSR ## 安装 @@ -79,7 +83,7 @@ vant 也支持按需引入、CDN 引入等方式,详细说明见 [快速上手 ## 生态 | 项目 | 描述 | -|-----|------| +| --- | --- | | [vant-demo](https://github.com/youzan/vant-demo) | Vant 官方示例合集 | | [vant-weapp](https://github.com/youzan/vant-weapp) | 微信小程序组件库 | | [vant-cli](https://github.com/youzan/vant/tree/dev/packages/vant-cli) | 开箱即用的组件库搭建工具 | @@ -88,9 +92,9 @@ vant 也支持按需引入、CDN 引入等方式,详细说明见 [快速上手 ## 链接 -* [详细文档](https://youzan.github.io/vant) -* [更新日志](https://youzan.github.io/vant#/zh-CN/changelog) -* [码云镜像](https://gitee.com/organizations/vant-contrib) +- [详细文档](https://youzan.github.io/vant) +- [更新日志](https://youzan.github.io/vant#/zh-CN/changelog) +- [码云镜像](https://gitee.com/organizations/vant-contrib) ## 手机预览 diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 3198209f9..b51645c41 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -1,5 +1,205 @@ # Changelog +### Intro + +Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/). + +**Release Schedule** + +- Patch version:released weekly, including features and bug fixes. +- Minor version:released every one to two months, including backwards compatible features. +- Major version:including breaking changes and new features. + +### [v2.6.2](https://github.com/youzan/vant/compare/v2.6.1...v2.6.2) + +`2020-04-18` + +**Feature** + +- Empty: support offline scenario [#6055](https://github.com/youzan/vant/issues/6055) +- NoticeBar: add replay event [#6079](https://github.com/youzan/vant/issues/6079) +- Overlay: add lock-scroll prop [#6082](https://github.com/youzan/vant/issues/6082) +- Uploader: add lazy-load prop [#6083](https://github.com/youzan/vant/issues/6083) + +**Bug Fixes** + +- Checkbox: get changed value in click event [#6066](https://github.com/youzan/vant/issues/6066) +- Picker: setColumnValues failed in cascade mode [#6080](https://github.com/youzan/vant/issues/6080) +- Slider: incorrect bar-height when vertical [#6065](https://github.com/youzan/vant/issues/6065) +- Swipe: incorrect width after resize if hidden [#6084](https://github.com/youzan/vant/issues/6084) + +### [v2.6.1](https://github.com/youzan/vant/compare/v2.6.0...v2.6.1) + +`2020-04-14` + +**Feature** + +- AddressEdit: add area-placeholder prop [#6023](https://github.com/youzan/vant/issues/6023) +- ImagePreview: support local registration [#6031](https://github.com/youzan/vant/issues/6031) + +**Bug Fixes** + +- sortChildren broke SSR [#6046](https://github.com/youzan/vant/issues/6046) +- Calendar: default-date should be today, close #6025 [#6025](https://github.com/youzan/vant/issues/6025) [#6028](https://github.com/youzan/vant/issues/6028) + +### [v2.6.0](https://github.com/youzan/vant/compare/v2.5.9...v2.6.0) + +`2020-04-09` + +**Feature** + +- add ShareSheet component [#6019](https://github.com/youzan/vant/issues/6019) +- add Empty component [#6010](https://github.com/youzan/vant/issues/6010) + +**Feature** + +- Form: add show-error prop [#5941](https://github.com/youzan/vant/issues/5941) +- Tabbar: add placeholder prop [#5979](https://github.com/youzan/vant/issues/5979) +- Sku: enable safe-area-inset-bottom by default [#5960](https://github.com/youzan/vant/issues/5960) +- Tabbar: enable safe-area-inset-bottom by default when fixed [#5968](https://github.com/youzan/vant/issues/5968) +- SubmitBar: enable safe-area-inset-bottom by default [#5956](https://github.com/youzan/vant/issues/5956) +- GoodsAction: enable safe-area-inset-bottom by default [#5955](https://github.com/youzan/vant/issues/5955) +- Swipe: allow swipe multiple item at once [#5953](https://github.com/youzan/vant/issues/5953) +- Calendar: auto selected to max range [#5992](https://github.com/youzan/vant/issues/5992) + +**Improvement** + +- NavBar: improve active feedback [#5949](https://github.com/youzan/vant/issues/5949) +- Popup: improve leave animation timing function [#5954](https://github.com/youzan/vant/issues/5954) +- Picker: improve scroll speed [#5951](https://github.com/youzan/vant/issues/5951) +- Swipe: improve swipe threshold [#6003](https://github.com/youzan/vant/issues/6003) +- TreeSelect: update nav background color [#5991](https://github.com/youzan/vant/issues/5991) + +**Bug Fixes** + +- Button: icon-prefix prop not work [#5947](https://github.com/youzan/vant/issues/5947) +- Calendar: rendering error when activated [#5978](https://github.com/youzan/vant/issues/5978) +- Form: incorrect validation order when add field dynamically [b8dea3](https://github.com/youzan/vant/commit/b8dea3c13b7dbf6533169653c493a3156c07f1d4) +- NavBar: icon align center [#5948](https://github.com/youzan/vant/issues/5948) +- Stepper: readonly not work in lagacy mobile safari [#5976](https://github.com/youzan/vant/issues/5976) + +### [v2.5.9](https://github.com/youzan/vant/compare/v2.5.8...v2.5.9) + +`2020-03-31` + +**Feature** + +- AddressEdit: add click-area event [#5939](https://github.com/youzan/vant/issues/5939) +- NavBar: add placeholder prop [#5938](https://github.com/youzan/vant/issues/5938) +- Steps: add click-step event [#5937](https://github.com/youzan/vant/issues/5937) + +**Bug Fixes** + +- NumberKeyboard: show-delete-key prop not work [#5935](https://github.com/youzan/vant/issues/5935) +- Toast: incorrect height in legacy devices [#5931](https://github.com/youzan/vant/issues/5931) +- Sticky: Fixed error when accessing the window during SSR [#5958](https://github.com/youzan/vant/issues/5958) + +### [v2.5.8](https://github.com/youzan/vant/compare/v2.5.7...v2.5.8) + +`2020-03-27` + +**Feature** + +- support generate webstorm types [#5900](https://github.com/youzan/vant/issues/5900) +- Circle: improve text padding [10f32d](https://github.com/youzan/vant/commit/10f32d6619199e99ff743cb5425db1e54e495fd0) +- Form: add show-error-message prop [#5927](https://github.com/youzan/vant/issues/5927) +- ImagePreview: enable swipe lazy-render [#5879](https://github.com/youzan/vant/issues/5879) +- Sidebar: set overflow-y auto [#5921](https://github.com/youzan/vant/issues/5921) +- Swipe: add lazy-render prop [365f2b](https://github.com/youzan/vant/commit/365f2b16f7d9592f92413e206439585468a8a1c7) +- Swipe: use flex layout [f701de](https://github.com/youzan/vant/commit/f701de9e58db5f88a582e3277c97a0c9ca99eec4) + +**Bug Fixes** + +- Calendar: fix the default date of multiple selection type [#5907](https://github.com/youzan/vant/issues/5907) +- PullRefresh: track should be full of container [#5878](https://github.com/youzan/vant/issues/5878) +- Sticky: shoud rerender after visibility changed [#5888](https://github.com/youzan/vant/issues/5888) +- Swipe: incorrect offset after resize [#5922](https://github.com/youzan/vant/issues/5922) + +### [v2.5.7](https://github.com/youzan/vant/compare/v2.5.6...v2.5.7) + +`2020-03-20` + +**Bug Fixes** + +- Locale: fix incorrect japanese filename [e8c88a](https://github.com/youzan/vant/commit/e8c88a380217eb48cef8aa7dc29d378a1031120a) + +### [v2.5.6](https://github.com/youzan/vant/compare/v2.5.5...v2.5.6) + +`2020-03-20` + +**Feature** + +- Calendar: add allow-same-day prop [#5688](https://github.com/youzan/vant/issues/5688) +- GoodsAction: add badge prop, mark info prop as deprecated [0dea9e](https://github.com/youzan/vant/commit/0dea9e2cb1562decc07ef4467d085247b91924fd) +- GridItem: add badge prop, mark info prop as deprecated [db94b2](https://github.com/youzan/vant/commit/db94b20c8258ebb31bac99ea1f0c918d62de1059) +- Icon: add badge prop, mark info prop deprecated [575577](https://github.com/youzan/vant/commit/575577ed58a1e6daa36ffba7db8054556aa0d24d) +- ImagePreview: add closed event [5b279a](https://github.com/youzan/vant/commit/5b279ab0dc862c0a3257d18fe17d04ed8dd8c1dd) +- locale: add japanese language [#5853](https://github.com/youzan/vant/issues/5853) [#5854](https://github.com/youzan/vant/issues/5854) +- SidebarItem: add badge prop, mark info prop as deprecated [01482f](https://github.com/youzan/vant/commit/01482f20bc2150a7e4667fac062b4f129b0ac0c1) +- Tab: add badge prop, mark info prop as deprecated [214b13](https://github.com/youzan/vant/commit/214b13b8fff411a401fe6ccfc9eb979a51df7461) +- TabbarItem: add badge prop, mark info prop as deprecated [d61cbd](https://github.com/youzan/vant/commit/d61cbdd086c9050fa467803be676a1eb14d50f16) +- TreeSelect: add badge option, mark info option as deprecated [0cc7a3](https://github.com/youzan/vant/commit/0cc7a305287f43314910f893092c09004cef5349) +- Uploader: add chooseFile method [#5818](https://github.com/youzan/vant/issues/5818) +- Uploader: add show-upload prop [66c0b3](https://github.com/youzan/vant/commit/66c0b3c1b7d101f242071cf90e5c0b2b899edbdd) +- Uploader: use before read promise resolved value [#5813](https://github.com/youzan/vant/issues/5813) + +**Bug Fixes** + +- Calendar: incorret button native-type [#5873](https://github.com/youzan/vant/issues/5873) +- Field: should not cache input slot [#5868](https://github.com/youzan/vant/issues/5868) +- ImagePreview: should not show previews image [7fcfc5](https://github.com/youzan/vant/commit/7fcfc5f3270d3507a002247c53a29da211f1ecb6) +- Picker: update cascade after setColumnIndex [#5807](https://github.com/youzan/vant/issues/5807) +- Picker: update cascade after setColumnValue [#5807](https://github.com/youzan/vant/issues/5807) +- Toast: should lock scroll when use forbidClick [df8777](https://github.com/youzan/vant/commit/df877751b3497eb6477797ee1a52933067e57676) + +### [v2.5.5](https://github.com/youzan/vant/compare/v2.5.4...v2.5.5) + +`2020-03-11` + +**Feature** + +- Calendar: add show-title prop [#5779](https://github.com/youzan/vant/issues/5779) +- Calendar: add show-subtitle prop [#5779](https://github.com/youzan/vant/issues/5779) +- Field: improve number keyboard [e89baa](https://github.com/youzan/vant/commit/e89baa12ae24dbd27466bd6ec694074ab99acf5d) +- Stepper: improve number keyboard [58e74a](https://github.com/youzan/vant/commit/58e74a9e8bfc36f69103c6a301170c5f6ada03dd) +- GoodsActionIcon: add dot prop [b983ac](https://github.com/youzan/vant/commit/b983ac08919056e1095767d1deb3f78e5274b41c) + +**Bug Fixes** + +- AddressEdit: check addressDetail only when showDetail is true [#5803](https://github.com/youzan/vant/issues/5803) +- Calendar: color not work in multiple mode [#5786](https://github.com/youzan/vant/issues/5786) +- Field: should not get formValue from button slot [#5785](https://github.com/youzan/vant/issues/5785) +- GoodsActionIcon: info not work with icon slot [#5788](https://github.com/youzan/vant/issues/5788) +- Stepper: skip form number validation [#5792](https://github.com/youzan/vant/issues/5792) +- Sticky: should not detect scroll when hidden [41e5c0](https://github.com/youzan/vant/commit/41e5c035dcf75c1f1d4c04673d3db255e439d452) + +### [v2.5.4](https://github.com/youzan/vant/compare/v2.5.3...v2.5.4) + +`2020-03-08` + +**Feature** + +- Calendar: add multiple type [#5705](https://github.com/youzan/vant/issues/5705) +- Field: input inherit line-height [#5737](https://github.com/youzan/vant/issues/5737) +- Search: add left slot [#5771](https://github.com/youzan/vant/issues/5771) +- Uploader: add upload-icon prop [b3b46c](https://github.com/youzan/vant/commit/b3b46cde45f885b746a2a633e5fc0e87e1881abe) +- Uploader: increase border-radius to 8px [c67918](https://github.com/youzan/vant/commit/c6791841f4b06e699a684da0243526147438d852) +- Uploader: update upload area style [bd4e64](https://github.com/youzan/vant/commit/bd4e64190e63eea30c342ea5255d8603a70385f9) + +**Bug Fixes** + +- Calendar: incorrect position when poppable is false [#5760](https://github.com/youzan/vant/issues/5760) +- DropdownMenu: menu ref may not exist in some cases [#5770](https://github.com/youzan/vant/issues/5770) +- Tabs: incorrect scrollspy position while inside a scroller [0993b3](https://github.com/youzan/vant/commit/0993b394b16fdbf92bdf02d39090e631bba1f471) +- Tabs: lock scroll not work when using scrollspy [#5727](https://github.com/youzan/vant/issues/5727) +- TimePicker: incorrect value when set min-minute dynamically [#5767](https://github.com/youzan/vant/issues/5767) + +**Types** + +- Form: fix missing scrollToField method [df4439](https://github.com/youzan/vant/commit/df4439e9f6759a446b522652233703601093e99d) +- ImagePreview: fix missing closeable option [d5438d](https://github.com/youzan/vant/commit/d5438dfe0dc9df22e94881b57def33207eca44e6) +- Toast: fix missing iconPrefix option [3237e5](https://github.com/youzan/vant/commit/3237e56561e1b6b80ea3431f3b8a9f30f61d4b08) + ### [v2.5.3](https://github.com/youzan/vant/compare/v2.5.2...v2.5.3) `2020-02-28` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index ad5b13287..c94404eb2 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,6 +10,200 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.6.2](https://github.com/youzan/vant/compare/v2.6.1...v2.6.2) + +`2020-04-18` + +**Feature** + +- Empty: 支持在离线环境下使用 network 图片 [#6055](https://github.com/youzan/vant/issues/6055) +- NoticeBar: 新增 replay 事件,在每次滚动结束时触发 [#6079](https://github.com/youzan/vant/issues/6079) +- Overlay: 新增 lock-scroll 属性,用于控制是否锁定背景滚动 [#6082](https://github.com/youzan/vant/issues/6082) +- Uploader: 新增 lazy-load 属性,用于开启图片懒加载 [#6083](https://github.com/youzan/vant/issues/6083) + +**Bug Fixes** + +- Checkbox: 修复在 click 事件的回调中获取到的 value 未改变的问题 [#6066](https://github.com/youzan/vant/issues/6066) +- Picker: 修复级联模式下使用 setColumnValues 方法导致报错的问题 [#6080](https://github.com/youzan/vant/issues/6080) +- Slider: 修复在垂直模式下使用 bar-height 后样式错误的问题 [#6065](https://github.com/youzan/vant/issues/6065) +- Swipe: 修复元素隐藏且触发 resize 事件后渲染错误的问题 [#6084](https://github.com/youzan/vant/issues/6084) + +### [v2.6.1](https://github.com/youzan/vant/compare/v2.6.0...v2.6.1) + +`2020-04-14` + +**Feature** + +- AddressEdit: 新增 area-placeholder 属性 [#6023](https://github.com/youzan/vant/issues/6023) +- ImagePreview: 支持通过局部注册的方式使用 [#6031](https://github.com/youzan/vant/issues/6031) + +**Bug Fixes** + +- Calendar: 修复 default-date 默认值为 min-date 而不是今天的问题 [#6025](https://github.com/youzan/vant/issues/6025) [#6028](https://github.com/youzan/vant/issues/6028) +- 修复部分组件在 SSR 时报错 `Cannot read property 'children' of null` 的问题 [#6046](https://github.com/youzan/vant/issues/6046) + +### [v2.6.0](https://github.com/youzan/vant/compare/v2.5.9...v2.6.0) + +`2020-04-09` + +**Feature** + +- 新增 ShareSheet 分享面板组件,用于进行分享操作 [#6019](https://github.com/youzan/vant/issues/6019) +- 新增 Empty 空状态组件,作为空状态时的占位提示 [#6010](https://github.com/youzan/vant/issues/6010) + +{description}
; + } + }, + + genBottom() { + const slot = this.slots(); + + if (slot) { + return描述文字
+描述文字
+描述文字
+描述文字
+ +Custom description
+