Merge branch 'dev' into next

This commit is contained in:
chenjiahan 2020-08-09 20:40:22 +08:00
commit 7f76852ef3
12 changed files with 169 additions and 151 deletions

View File

@ -10,107 +10,57 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
- Minor versionreleased every one to two months, including backwards compatible features.
- Major versionincluding 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)

View File

@ -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)

View File

@ -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",

View File

@ -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 |

View File

@ -155,3 +155,10 @@ Vue.use(Button);
| ---------- | ---------------------------------------- | ------------------- |
| click | 点击按钮,且按钮状态不为加载或禁用时触发 | _event: Event_ |
| touchstart | 开始触摸按钮时触发 | _event: TouchEvent_ |
### Slots
| 名称 | 说明 |
| ----------------- | -------------- |
| default | 按钮内容 |
| loading `v2.10.1` | 自定义加载图标 |

View File

@ -63,12 +63,16 @@ export default createComponent({
if (this.loading) {
Content.push(
<Loading
class={bem('loading')}
size={this.loadingSize}
type={this.loadingType}
color="currentColor"
/>
this.$slots.loading ? (
this.$slots.loading()
) : (
<Loading
class={bem('loading')}
size={this.loadingSize}
type={this.loadingType}
color="currentColor"
/>
)
);
} else if (this.icon) {
Content.push(

View File

@ -7,6 +7,12 @@ exports[`icon-prefix prop 1`] = `
</button>
`;
exports[`loading slot 1`] = `
<button class="van-button van-button--default van-button--normal van-button--loading">
<div class="van-button__content">Custom Loading</div>
</button>
`;
exports[`loading-size prop 1`] = `
<button class="van-button van-button--default van-button--normal van-button--loading">
<div class="van-button__content">

View File

@ -93,3 +93,16 @@ test('icon-prefix prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('loading slot', () => {
const wrapper = mount(Button, {
propsData: {
loading: true,
},
scopedSlots: {
loading: () => 'Custom Loading',
},
});
expect(wrapper).toMatchSnapshot();
});

View File

@ -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).

View File

@ -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 配置文件。

78
src/locale/lang/nb-NO.ts Normal file
View File

@ -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',
},
};

View File

@ -159,7 +159,7 @@ export default {
| v-model:show | 是否显示分享面板 | _boolean_ | `false` |
| options | 分享选项 | _Option[]_ | `[]` |
| title | 顶部标题 | _string_ | - |
| cancel-text | 取消按钮文字 | _string_ | `'取消'` |
| cancel-text | 取消按钮文字,传入空字符串可以隐藏按钮 | _string_ | `'取消'` |
| description | 标题下方的辅助描述文字 | _string_ | - |
| duration | 动画时长,单位秒 | _number \| string_ | `0.3` |
| overlay | 是否显示遮罩层 | _boolean_ | `true` |