From 3e86cd0cb5502fa06d83454d26325725552815be Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 7 Aug 2020 10:13:45 +0800 Subject: [PATCH 1/6] chore: release 2.10.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 87cf2f454..a9925ea62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.10.0-beta.5", + "version": "2.10.0", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", From ca220e7d9ba97009cebb2db6b5f1d1e74f85d05d Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Fri, 7 Aug 2020 10:22:48 +0800 Subject: [PATCH 2/6] docs(changelog): 2.10.0 --- docs/markdown/changelog.en-US.md | 94 ++++++++------------------------ docs/markdown/changelog.zh-CN.md | 93 ++++++++----------------------- 2 files changed, 44 insertions(+), 143 deletions(-) diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 28d8e4f9d..18be4b66e 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -10,107 +10,57 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/). - Minor version:released every one to two months, including backwards compatible features. - Major version:including breaking changes and new features. -### [v2.10.0-beta.5](https://github.com/youzan/vant/compare/v2.10.0-beta.4...v2.10.0-beta.5) +### [v2.10.0](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0) -`2020-08-06` - -**style** - -- NumberKeyboard: adjust padding bottom [#6938](https://github.com/youzan/vant/issues/6938) - -**Bug Fixes** - -- AddressEdit: render error in some cases [#6942](https://github.com/youzan/vant/issues/6942) -- Dialog: incorrect padding with round-button theme [#6936](https://github.com/youzan/vant/issues/6936) -- Info: number vertical align center [#6952](https://github.com/youzan/vant/issues/6952) -- NumberKeyboard: incorrect key height on legacy safari [#6937](https://github.com/youzan/vant/issues/6937) -- Picker: When item.defaultIndex is 0, this.defaultIndex will be used [#6948](https://github.com/youzan/vant/issues/6948) -- Sku: header image shrink [#6949](https://github.com/youzan/vant/issues/6949) - -### [v2.10.0-beta.4](https://github.com/youzan/vant/compare/v2.10.0-beta.3...v2.10.0-beta.4) - -`2020-08-04` - -- Revert "fix(Icon): incorrect image icon height when loading (#6858)" [#6858](https://github.com/youzan/vant/issues/6858) - -### [v2.10.0-beta.3](https://github.com/youzan/vant/compare/v2.10.0-beta.2...v2.10.0-beta.3) - -`2020-08-04` - -**style** - -- Dialog: fix round-button theme [#6934](https://github.com/youzan/vant/issues/6934) - -### [v2.10.0-beta.2](https://github.com/youzan/vant/compare/v2.10.0-beta.1...v2.10.0-beta.2) - -`2020-08-03` - -**Feature** - -- Dialog: add new prop theme [#6921](https://github.com/youzan/vant/issues/6921) -- Icon: add back-top icon [#6931](https://github.com/youzan/vant/issues/6931) - -**style** - -- Image: adjust icon color to @gray-4 [729cca](https://github.com/youzan/vant/commit/729cca61a978ba243cf442143ae85d2abb464de0) -- Tab: disable ellipsis when scrollable [bc0e45](https://github.com/youzan/vant/commit/bc0e45687a76f49355efa7fb2403184746575012) - -**Bug Fixes** - -- Calendar: should only scroll calendar body when inited [#6926](https://github.com/youzan/vant/issues/6926) - -### [v2.10.0-beta.1](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0-beta.1) - -`2020-07-31` - -**Feature** - -- Icon: add photo-fail icon [#6883](https://github.com/youzan/vant/issues/6883) -- DropdownMenu: add @dropdown-menu-box-shadow var [6d0c54](https://github.com/youzan/vant/commit/6d0c54e8f4e9c1c9982778df8a36c7ac3fc2f905) - -**style** - -- CouponCell: insert a space after currency [#6888](https://github.com/youzan/vant/issues/6888) -- Image: update loading icon and error icon [#6890](https://github.com/youzan/vant/issues/6890) -- NumberKeyboard: adjust key height to 28px [#6899](https://github.com/youzan/vant/issues/6899) -- Sku: improve price align [#6911](https://github.com/youzan/vant/issues/6911) -- Tab: remove default border [69ac60](https://github.com/youzan/vant/commit/69ac602bc21b445fb88783303d00bd65e4dc5ae2) -- Tab: adjust padding in complete mode [90e678](https://github.com/youzan/vant/commit/90e678756aecddee2beb522e38017c68f616b387) -- Tab: update nav padding [8027f4](https://github.com/youzan/vant/commit/8027f46f3ff33b200cf022e5f9a2693293a1bb16) - -### [v2.10.0-beta.0](https://github.com/youzan/vant/compare/v2.9.4-beta.0...v2.10.0-beta.0) - -`2020-07-25` +`2020-08-07` **Feature** - AddressEdit: add tel-maxlength prop [#6869](https://github.com/youzan/vant/issues/6869) - Calendar: enable close-on-popstate by default [#6874](https://github.com/youzan/vant/issues/6874) +- Dialog: add new prop theme [#6921](https://github.com/youzan/vant/issues/6921) - Dialog: enable close-on-popsate by default [#6873](https://github.com/youzan/vant/issues/6873) +- DropdownMenu: add @dropdown-menu-box-shadow var [6d0c54](https://github.com/youzan/vant/commit/6d0c54e8f4e9c1c9982778df8a36c7ac3fc2f905) +- Icon: add back-top icon [#6931](https://github.com/youzan/vant/issues/6931) +- Icon: add photo-fail icon [#6883](https://github.com/youzan/vant/issues/6883) - ImagePreview: enable close-on-popstate by default [#6875](https://github.com/youzan/vant/issues/6875) - NumberKeyboard: add get-container prop [#6870](https://github.com/youzan/vant/issues/6870) **style** - uniform line-height [#6862](https://github.com/youzan/vant/issues/6862) -- DropdownMenu: adjust default active color to @red [#6863](https://github.com/youzan/vant/issues/6863) - ActionSheet: add @action-sheet-loading-icon-size var [#6847](https://github.com/youzan/vant/issues/6847) - ActionSheet: adjust cancel text color to @gray-7 [#6846](https://github.com/youzan/vant/issues/6846) - ActionSheet: increase header height to 48px [#6856](https://github.com/youzan/vant/issues/6856) - Cell: adjust icon margin to 4px [#6844](https://github.com/youzan/vant/issues/6844) +- CouponCell: insert a space after currency [#6888](https://github.com/youzan/vant/issues/6888) +- DropdownMenu: adjust default active color to @red [#6863](https://github.com/youzan/vant/issues/6863) +- Image: update loading icon and error icon [#6890](https://github.com/youzan/vant/issues/6890) - Field: adjust icon margin to 4px [#6849](https://github.com/youzan/vant/issues/6849) - NumberKeyboard: increase title size [#6845](https://github.com/youzan/vant/issues/6845) +- NumberKeyboard: adjust padding bottom [#6938](https://github.com/youzan/vant/issues/6938) +- NumberKeyboard: adjust key height to 28px [#6899](https://github.com/youzan/vant/issues/6899) - Picker: adjust default value of visible-item-count to 6 [#6827](https://github.com/youzan/vant/issues/6827) - Sidebar: adjust width to 80px [#6861](https://github.com/youzan/vant/issues/6861) +- Sku: improve price align [#6911](https://github.com/youzan/vant/issues/6911) - Tag: adjust size and padding [#6828](https://github.com/youzan/vant/issues/6828) +- Tab: remove default border [69ac60](https://github.com/youzan/vant/commit/69ac602bc21b445fb88783303d00bd65e4dc5ae2) +- Tab: adjust padding in complete mode [90e678](https://github.com/youzan/vant/commit/90e678756aecddee2beb522e38017c68f616b387) +- Tab: update nav padding [8027f4](https://github.com/youzan/vant/commit/8027f46f3ff33b200cf022e5f9a2693293a1bb16) +- Tab: disable ellipsis when scrollable [bc0e45](https://github.com/youzan/vant/commit/bc0e45687a76f49355efa7fb2403184746575012) - Toast: adjust background color [#6848](https://github.com/youzan/vant/issues/6848) - Toast: adjust icon size to 36px [#6857](https://github.com/youzan/vant/issues/6857) **Bug Fixes** +- AddressEdit: render error in some cases [#6942](https://github.com/youzan/vant/issues/6942) +- Calendar: should only scroll calendar body when inited [#6926](https://github.com/youzan/vant/issues/6926) - Field: failed to reset validation when message is empty [#6867](https://github.com/youzan/vant/issues/6867) -- Icon: incorrect image icon height when loading [#6858](https://github.com/youzan/vant/issues/6858) +- Info: number vertical align center [#6952](https://github.com/youzan/vant/issues/6952) - ImagePreview: fit orientationchange [#6825](https://github.com/youzan/vant/issues/6825) +- NumberKeyboard: incorrect key height on legacy safari [#6937](https://github.com/youzan/vant/issues/6937) +- Picker: when item.defaultIndex is 0, this.defaultIndex will be used [#6948](https://github.com/youzan/vant/issues/6948) +- Sku: fix header image shrink [#6949](https://github.com/youzan/vant/issues/6949) ### [v2.9.4](https://github.com/youzan/vant/compare/v2.9.3...v2.9.4) diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index b83943cf3..b6df7cc37 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,107 +10,58 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 -### [v2.10.0-beta.5](https://github.com/youzan/vant/compare/v2.10.0-beta.4...v2.10.0-beta.5) +### [v2.10.0](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0) -`2020-08-06` - -**style** - -- NumberKeyboard: 减少底部留白大小 [#6938](https://github.com/youzan/vant/issues/6938) -- Dialog: 优化使用 round-button 主题时的内边距 [#6936](https://github.com/youzan/vant/issues/6936) - -**Bug Fixes** - -- AddressEdit: 修复个别情况下按钮渲染错误的问题 [#6942](https://github.com/youzan/vant/issues/6942) -- Info: 修复 badge 的数字在 iOS 上不居中的问题 [#6952](https://github.com/youzan/vant/issues/6952) -- NumberKeyboard: 修复在低版本 safari 上按键高度错误的问题 [#6937](https://github.com/youzan/vant/issues/6937) -- Picker: 修复 defaultIndex 在个别情况下取值逻辑错误的问题 [#6948](https://github.com/youzan/vant/issues/6948) -- Sku: 修复价格较长时顶部图片的宽度被压缩的问题 [#6949](https://github.com/youzan/vant/issues/6949) - -### [v2.10.0-beta.4](https://github.com/youzan/vant/compare/v2.10.0-beta.3...v2.10.0-beta.4) - -`2020-08-04` - -- 回滚 "fix(Icon): 修复图片图标加载过程中高度异常的问题 (#6858)" [#6858](https://github.com/youzan/vant/issues/6858) - -### [v2.10.0-beta.3](https://github.com/youzan/vant/compare/v2.10.0-beta.2...v2.10.0-beta.3) - -`2020-08-04` - -**style** - -- Dialog: 修复 round-theme 弹窗样式错误的问题 [#6934](https://github.com/youzan/vant/issues/6934) - -### [v2.10.0-beta.2](https://github.com/youzan/vant/compare/v2.10.0-beta.1...v2.10.0-beta.2) - -`2020-08-03` - -**Feature** - -- Dialog: 新增 theme 属性,用于展示圆角按钮风格的弹窗 [#6921](https://github.com/youzan/vant/issues/6921) -- Icon: 新增 back-top 图标 [#6931](https://github.com/youzan/vant/issues/6931) - -**style** - -- Dialog: 确认按钮的默认颜色调整为红色 [#6921](https://github.com/youzan/vant/issues/6921) -- Image: 加载图标和错误图标的颜色调整为 @gray-4 [729cca](https://github.com/youzan/vant/commit/729cca61a978ba243cf442143ae85d2abb464de0) -- Tab: 在横向滚动模式下默认不截断标题的文字 [bc0e45](https://github.com/youzan/vant/commit/bc0e45687a76f49355efa7fb2403184746575012) - -**Bug Fixes** - -- Calendar: 修复初始化日历时页面滚动条位置错误的问题 [#6926](https://github.com/youzan/vant/issues/6926) - -### [v2.10.0-beta.1](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0-beta.1) - -`2020-07-31` - -**Feature** - -- Icon: 新增 photo-fail 图标 [#6883](https://github.com/youzan/vant/issues/6883) -- DropdownMenu: 新增 @dropdown-menu-box-shadow 变量 [6d0c54](https://github.com/youzan/vant/commit/6d0c54e8f4e9c1c9982778df8a36c7ac3fc2f905) - -**style** - -- Tab: 移除默认边框 [69ac60](https://github.com/youzan/vant/commit/69ac602bc21b445fb88783303d00bd65e4dc5ae2) -- Tab: 优化标签间距 [90e678](https://github.com/youzan/vant/commit/90e678756aecddee2beb522e38017c68f616b387) [8027f4](https://github.com/youzan/vant/commit/8027f46f3ff33b200cf022e5f9a2693293a1bb16) -- Image: 更新加载图标和错误图标 [#6890](https://github.com/youzan/vant/issues/6890) -- CouponCell: 优化金额与符号的间隔 [#6888](https://github.com/youzan/vant/issues/6888) -- Sku: 优化价格符号位置,与下方文案对齐 [#6911](https://github.com/youzan/vant/issues/6911) -- NumberKeyboard: 调整按键高度为 28px,增加底部空白区域 [#6899](https://github.com/youzan/vant/issues/6899) - -### [v2.10.0-beta.0](https://github.com/youzan/vant/compare/v2.9.4-beta.0...v2.10.0-beta.0) - -`2020-07-25` +`2020-08-07` **Feature** - AddressEdit: 新增 tel-maxlength 属性 [#6869](https://github.com/youzan/vant/issues/6869) - Calendar: 默认开启 close-on-popstate 属性 [#6874](https://github.com/youzan/vant/issues/6874) - Dialog: 默认开启 close-on-popstate 属性 [#6873](https://github.com/youzan/vant/issues/6873) +- Dialog: 新增 theme 属性,用于展示圆角按钮风格的弹窗 [#6921](https://github.com/youzan/vant/issues/6921) +- DropdownMenu: 新增 @dropdown-menu-box-shadow 变量 [6d0c54](https://github.com/youzan/vant/commit/6d0c54e8f4e9c1c9982778df8a36c7ac3fc2f905) +- Icon: 新增 back-top 图标 [#6931](https://github.com/youzan/vant/issues/6931) +- Icon: 新增 photo-fail 图标 [#6883](https://github.com/youzan/vant/issues/6883) - ImagePreview: 默认开启 close-on-popstate 属性 [#6875](https://github.com/youzan/vant/issues/6875) - NumberKeyboard: 新增 get-container 属性 [#6870](https://github.com/youzan/vant/issues/6870) **style** - 新增 line-height 相关 LESS 变量 [#6862](https://github.com/youzan/vant/issues/6862) -- DropdownMenu: 默认选中态颜色调整为红色 [#6863](https://github.com/youzan/vant/issues/6863) - ActionSheet: 加载图标大小调整为 22px [#6847](https://github.com/youzan/vant/issues/6847) - ActionSheet: 取消按钮文字颜色调整为 @gray-7 [#6846](https://github.com/youzan/vant/issues/6846) - ActionSheet: 标题栏高度调整为 48px [#6856](https://github.com/youzan/vant/issues/6856) - Cell: 图标与文字的间距调整为 4px [#6844](https://github.com/youzan/vant/issues/6844) +- CouponCell: 优化金额与符号的间隔 [#6888](https://github.com/youzan/vant/issues/6888) +- Dialog: 确认按钮的默认颜色调整为红色 [#6921](https://github.com/youzan/vant/issues/6921) +- DropdownMenu: 默认选中态颜色调整为红色 [#6863](https://github.com/youzan/vant/issues/6863) - Field: 图标与文字的间距调整为 4px [#6849](https://github.com/youzan/vant/issues/6849) +- Image: 更新加载图标和错误图标 [#6890](https://github.com/youzan/vant/issues/6890) +- NumberKeyboard: 增加底部空白区域 [#6938](https://github.com/youzan/vant/issues/6938) +- NumberKeyboard: 调整按键高度为 28px [#6899](https://github.com/youzan/vant/issues/6899) - NumberKeyboard: 标题栏高度调整为 40px [#6845](https://github.com/youzan/vant/issues/6845) - Picker: 默认可见的选项个数调整为 6 个 [#6827](https://github.com/youzan/vant/issues/6827) - Sidebar: 宽度调整为 80px [#6861](https://github.com/youzan/vant/issues/6861) +- Sku: 优化价格符号位置,与下方文案对齐 [#6911](https://github.com/youzan/vant/issues/6911) - Tag: 更新文字大小和标签大小 [#6828](https://github.com/youzan/vant/issues/6828) +- Tab: 在横向滚动模式下默认不截断标题的文字 [bc0e45](https://github.com/youzan/vant/commit/bc0e45687a76f49355efa7fb2403184746575012) +- Tab: 移除默认边框 [69ac60](https://github.com/youzan/vant/commit/69ac602bc21b445fb88783303d00bd65e4dc5ae2) +- Tab: 优化标签间距 [90e678](https://github.com/youzan/vant/commit/90e678756aecddee2beb522e38017c68f616b387) [8027f4](https://github.com/youzan/vant/commit/8027f46f3ff33b200cf022e5f9a2693293a1bb16) - Toast: 更新背景色 [#6848](https://github.com/youzan/vant/issues/6848) - Toast: 图标大小调整为 36px [#6857](https://github.com/youzan/vant/issues/6857) **Bug Fixes** +- AddressEdit: 修复个别情况下按钮渲染错误的问题 [#6942](https://github.com/youzan/vant/issues/6942) +- Calendar: 修复初始化日历时页面滚动条位置错误的问题 [#6926](https://github.com/youzan/vant/issues/6926) - Field: 修复 rule 的 message 为空时无法重置表单状态的问题 [#6867](https://github.com/youzan/vant/issues/6867) - Icon: 修复图片图标加载过程中高度异常的问题 [#6858](https://github.com/youzan/vant/issues/6858) - ImagePreview: 修复 iOS 下旋转屏幕时布局错误的问题 [#6825](https://github.com/youzan/vant/issues/6825) +- Info: 修复 badge 的数字在 iOS 上不居中的问题 [#6952](https://github.com/youzan/vant/issues/6952) +- NumberKeyboard: 修复在低版本 safari 上按键高度错误的问题 [#6937](https://github.com/youzan/vant/issues/6937) +- Picker: 修复 defaultIndex 在个别情况下取值逻辑错误的问题 [#6948](https://github.com/youzan/vant/issues/6948) +- Sku: 修复价格较长时顶部图片的宽度被压缩的问题 [#6949](https://github.com/youzan/vant/issues/6949) ### [v2.9.4](https://github.com/youzan/vant/compare/v2.9.3...v2.9.4) From c0a2e8081a1b0bf65e4c6298c67ee1f11fab8126 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 7 Aug 2020 18:20:46 +0800 Subject: [PATCH 3/6] docs(ShareSheet): add hide cancel button guide (#6959) --- src/share-sheet/README.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/share-sheet/README.zh-CN.md b/src/share-sheet/README.zh-CN.md index b0338876c..f1ce56156 100644 --- a/src/share-sheet/README.zh-CN.md +++ b/src/share-sheet/README.zh-CN.md @@ -158,7 +158,7 @@ export default { | --- | --- | --- | --- | | options | 分享选项 | _Option[]_ | `[]` | | title | 顶部标题 | _string_ | - | -| cancel-text | 取消按钮文字 | _string_ | `'取消'` | +| cancel-text | 取消按钮文字,传入空字符串可以隐藏按钮 | _string_ | `'取消'` | | description | 标题下方的辅助描述文字 | _string_ | - | | duration | 动画时长,单位秒 | _number \| string_ | `0.3` | | overlay | 是否显示遮罩层 | _boolean_ | `true` | From 87bfaa7274a8fffbf5cfd8b07d0ac2a359d44757 Mon Sep 17 00:00:00 2001 From: Anders Date: Sat, 8 Aug 2020 15:17:08 +0200 Subject: [PATCH 4/6] adding Norwegian Language support (#6962) * adding Norwegian Language support * Rename no-NB.ts to nb-NO.ts --- src/locale/lang/nb-NO.ts | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/locale/lang/nb-NO.ts diff --git a/src/locale/lang/nb-NO.ts b/src/locale/lang/nb-NO.ts new file mode 100644 index 000000000..907cb8daf --- /dev/null +++ b/src/locale/lang/nb-NO.ts @@ -0,0 +1,78 @@ +export default { + name: 'Navn', + tel: 'Telefon', + save: 'Lagre', + confirm: 'Bekreft', + cancel: 'Avbryt', + delete: 'Slett', + complete: 'Fullfør', + loading: 'Laster...', + telEmpty: 'Vennligst fyll inn telefonnummer', + nameEmpty: 'Vennligst fyll inn navn', + nameInvalid: 'Ugyldig navn', + confirmDelete: 'Er du sikker på at du vil slette?', + telInvalid: 'Ugyldig telefonnummer', + vanCalendar: { + end: 'Slutt', + start: 'Start', + title: 'Kalendar', + startEnd: 'Start/Slutt', + weekdays: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'], + monthTitle: (year: number, month: number) => `${year}/${month}`, + rangePrompt: (maxRange: number) => `Maks. ${maxRange} dager`, + }, + vanContactCard: { + addText: 'Legg til kontakt info', + }, + vanContactList: { + addText: 'Legg til ny kontakt', + }, + vanPagination: { + prev: 'Forrige', + next: 'Neste', + }, + vanPullRefresh: { + pulling: 'Dra for oppdatering...', + loosing: 'Mist for oppdatering...', + }, + vanSubmitBar: { + label: 'Totalt:', + }, + vanCoupon: { + unlimited: 'Uendelig', + discount: (discount: number) => `${discount * 10}% avslag`, + condition: (condition: number) => `Minst ${condition}`, + }, + vanCouponCell: { + title: 'Kupong', + tips: 'Ingen kuponger', + count: (count: number) => `Du har ${count} kuponger`, + }, + vanCouponList: { + empty: 'Ingen kuponger', + exchange: 'Bytte', + close: 'Lukk', + enable: 'Tilgjengelig', + disabled: 'Utilgjengelig', + placeholder: 'Kupong kode', + }, + vanAddressEdit: { + area: 'Område', + postal: 'Postkode', + areaEmpty: 'Vennligst fyll inn område', + addressEmpty: 'Addresse kan ikke være tomt', + postalEmpty: 'Feil postkode', + defaultAddress: 'Sett som standard adresse', + telPlaceholder: 'Telefon', + namePlaceholder: 'Navn', + areaPlaceholder: 'Område', + }, + vanAddressEditDetail: { + label: 'Adresse', + placeholder: 'Adresse', + }, + vanAddressList: { + add: 'Legg til ny adresse', + }, + }; + From 3d8798ce3f52f0783fd88253028f919f3e08f989 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 8 Aug 2020 21:19:40 +0800 Subject: [PATCH 5/6] docs(locale): add Norwegian --- src/locale/README.md | 1 + src/locale/README.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/src/locale/README.md b/src/locale/README.md index 45e81da88..e7de47270 100644 --- a/src/locale/README.md +++ b/src/locale/README.md @@ -47,5 +47,6 @@ Current supported languages: | Spanish (Spain) | es-ES | | Japanese | ja-JP | | Romanian | ro-RO | +| Norwegian | nb-NO | > View all language configs [Here](https://github.com/youzan/vant/tree/dev/src/locale/lang). diff --git a/src/locale/README.zh-CN.md b/src/locale/README.zh-CN.md index 87d754e02..70e553401 100644 --- a/src/locale/README.zh-CN.md +++ b/src/locale/README.zh-CN.md @@ -47,6 +47,7 @@ Locale.add(messages); | 西班牙语 | es-ES | | 日语 | ja-JP | | 罗马尼亚语 | ro-RO | +| 挪威语 | nb-NO | > 在 [这里](https://github.com/youzan/vant/tree/dev/src/locale/lang) 查看所有的 i18n 配置文件。 From 927268cc25c0beb5e941c10b818cf591abe41543 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 9 Aug 2020 08:10:44 +0800 Subject: [PATCH 6/6] feat(Button): add loading slot (#6966) --- src/button/README.md | 7 +++++ src/button/README.zh-CN.md | 7 +++++ src/button/index.tsx | 26 ++++++++++++------- .../test/__snapshots__/index.spec.js.snap | 6 +++++ src/button/test/index.spec.js | 13 ++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/button/README.md b/src/button/README.md index 922c2de2b..b79d44c9b 100644 --- a/src/button/README.md +++ b/src/button/README.md @@ -132,3 +132,10 @@ Vue.use(Button); | --- | --- | --- | | click | Triggered when click button and not disabled or loading | _event: Event_ | | touchstart | Triggered when touch start | _event: TouchEvent_ | + +### Slots + +| Name | Description | +| ----------------- | ------------------- | +| default | Default slot | +| loading `v2.10.1` | Custom loading icon | diff --git a/src/button/README.zh-CN.md b/src/button/README.zh-CN.md index 8c01ac951..6d741ac99 100644 --- a/src/button/README.zh-CN.md +++ b/src/button/README.zh-CN.md @@ -155,3 +155,10 @@ Vue.use(Button); | ---------- | ---------------------------------------- | ------------------- | | click | 点击按钮,且按钮状态不为加载或禁用时触发 | _event: Event_ | | touchstart | 开始触摸按钮时触发 | _event: TouchEvent_ | + +### Slots + +| 名称 | 说明 | +| ----------------- | -------------- | +| default | 按钮内容 | +| loading `v2.10.1` | 自定义加载图标 | diff --git a/src/button/index.tsx b/src/button/index.tsx index 6b3c6e5c2..5cfd67ce8 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -10,7 +10,7 @@ import Loading, { LoadingType } from '../loading'; // Types import { CreateElement, RenderContext } from 'vue/types'; -import { DefaultSlots } from '../utils/types'; +import { ScopedSlot, DefaultSlots } from '../utils/types'; export type ButtonType = 'default' | 'primary' | 'info' | 'warning' | 'danger'; @@ -41,12 +41,16 @@ export type ButtonEvents = { onClick?(event: Event): void; }; +export type ButttonSlots = DefaultSlots & { + loading?: ScopedSlot; +}; + const [createComponent, bem] = createNamespace('button'); function Button( h: CreateElement, props: ButtonProps, - slots: DefaultSlots, + slots: ButttonSlots, ctx: RenderContext ) { const { @@ -112,12 +116,16 @@ function Button( if (loading) { content.push( - + slots.loading ? ( + slots.loading() + ) : ( + + ) ); } else if (icon) { content.push( @@ -188,4 +196,4 @@ Button.props = { }, }; -export default createComponent(Button); +export default createComponent(Button); diff --git a/src/button/test/__snapshots__/index.spec.js.snap b/src/button/test/__snapshots__/index.spec.js.snap index 239b474c2..6c8c5a8eb 100644 --- a/src/button/test/__snapshots__/index.spec.js.snap +++ b/src/button/test/__snapshots__/index.spec.js.snap @@ -7,6 +7,12 @@ exports[`icon-prefix prop 1`] = ` `; +exports[`loading slot 1`] = ` + +`; + exports[`loading-size prop 1`] = `