From 5debc352fffaa5d3cee35c8920f48e57ca203e35 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 17 Sep 2020 10:58:40 +0800 Subject: [PATCH 1/6] style(Dialog): add message min-height (#7191) --- src/dialog/Dialog.js | 2 +- src/dialog/index.less | 17 ++++++++++++++++- src/style/var.less | 4 +++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/dialog/Dialog.js b/src/dialog/Dialog.js index 19b9e694e..68359efac 100644 --- a/src/dialog/Dialog.js +++ b/src/dialog/Dialog.js @@ -187,7 +187,7 @@ export default createComponent({ }; return ( -
+
); diff --git a/src/dialog/index.less b/src/dialog/index.less index 8af647bf8..ad8a76b92 100644 --- a/src/dialog/index.less +++ b/src/dialog/index.less @@ -29,9 +29,18 @@ } } + &__content { + &--isolated { + display: flex; + align-items: center; + min-height: 104px; + } + } + &__message { + flex: 1; max-height: @dialog-message-max-height; - padding: @dialog-message-padding; + padding: 26px @dialog-message-padding; overflow-y: auto; font-size: @dialog-message-font-size; line-height: @dialog-message-line-height; @@ -65,6 +74,7 @@ &__confirm, &__cancel { flex: 1; + height: @dialog-button-height; margin: 0; border: 0; } @@ -88,6 +98,11 @@ color: @text-color; } + .van-dialog__confirm, + .van-dialog__cancel { + height: @dialog-round-button-height; + } + .van-dialog__confirm { color: @white; } diff --git a/src/style/var.less b/src/style/var.less index 08e075ce5..332bc6c5d 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -306,7 +306,7 @@ @dialog-background-color: @white; @dialog-header-font-weight: @font-weight-bold; @dialog-header-line-height: 24px; -@dialog-header-padding-top: @padding-lg; +@dialog-header-padding-top: 26px; @dialog-header-isolated-padding: @padding-lg 0; @dialog-message-padding: @padding-lg; @dialog-message-font-size: @font-size-md; @@ -314,6 +314,8 @@ @dialog-message-max-height: 60vh; @dialog-has-title-message-text-color: @gray-7; @dialog-has-title-message-padding-top: @padding-xs; +@dialog-button-height: 48px; +@dialog-round-button-height: 36px; @dialog-confirm-button-text-color: @red; // Divider From 9896d1f49ae4023aba9d1c786561ac6d845dc4eb Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 17 Sep 2020 11:01:40 +0800 Subject: [PATCH 2/6] style(Field): adjust placeholder color to gray-6 (#7192) --- src/style/var.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style/var.less b/src/style/var.less index 332bc6c5d..515e5ab2d 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -359,7 +359,7 @@ @field-input-text-color: @text-color; @field-input-error-text-color: @red; @field-input-disabled-text-color: @gray-5; -@field-placeholder-text-color: @gray-5; +@field-placeholder-text-color: @gray-6; @field-icon-size: 16px; @field-clear-icon-size: 16px; @field-clear-icon-color: @gray-5; From 38bde2a01f7129e53ace0641b332c9baee94020d Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 17 Sep 2020 11:18:02 +0800 Subject: [PATCH 3/6] fix(NumberKeyboard): slot content click event not work (#7193) --- src/number-keyboard/Key.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/number-keyboard/Key.js b/src/number-keyboard/Key.js index 858af2257..37987d205 100644 --- a/src/number-keyboard/Key.js +++ b/src/number-keyboard/Key.js @@ -48,7 +48,10 @@ export default createComponent({ onTouchEnd(event) { if (this.active) { // eliminate tap delay on safari - event.preventDefault(); + // see: https://github.com/youzan/vant/issues/6836 + if (!this.slots('default')) { + event.preventDefault(); + } this.active = false; this.$emit('press', this.text, this.type); } From 55e7fc89ec0fb7fc6957b67c05cd98388c3922d5 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 17 Sep 2020 11:26:31 +0800 Subject: [PATCH 4/6] chore: release 2.10.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6425c0570..57e2bf82d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.10.6", + "version": "2.10.7", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", From f0e5a1a428049aceb226de748b6eec071fc6637b Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 17 Sep 2020 11:31:55 +0800 Subject: [PATCH 5/6] docs(changelog): 2.10.7 --- docs/markdown/changelog.en-US.md | 25 +++++++++++++++++++++++++ docs/markdown/changelog.zh-CN.md | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 968b4e8f4..7a78d30a6 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -10,6 +10,31 @@ 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.7](https://github.com/youzan/vant/compare/v2.10.6...v2.10.7) + +`2020-09-17` + +**Feature** + +- Slider: add dual thumb mode for slider [#7176](https://github.com/youzan/vant/issues/7176) +- Button: add icon-position prop [#7174](https://github.com/youzan/vant/issues/7174) +- TabbarItem: add @tabbar-item-active-background-color less var [#7162](https://github.com/youzan/vant/issues/7162) + +**style** + +- Dialog: add message min-height [#7191](https://github.com/youzan/vant/issues/7191) +- Field: adjust placeholder color to gray-6 [#7192](https://github.com/youzan/vant/issues/7192) + +**Bug Fixes** + +- Calendar: incorrect height when using rem [#7190](https://github.com/youzan/vant/issues/7190) +- ImagePreview: incorrect move range in some cases [#7142](https://github.com/youzan/vant/issues/7142) +- NoticeBar: fix cache issues with forwards and back history in safari [#7167](https://github.com/youzan/vant/issues/7167) +- NumberKeyboard: incorrect extra key [#7150](https://github.com/youzan/vant/issues/7150) +- NumberKeyboard: slot content click event not work [#7193](https://github.com/youzan/vant/issues/7193) +- Tabs: incorrect scroll position when offset-top has unit [#7143](https://github.com/youzan/vant/issues/7143) +- Tag: text vertical align in miui [#7151](https://github.com/youzan/vant/issues/7151) + ### [v2.10.6](https://github.com/youzan/vant/compare/v2.10.5...v2.10.6) `2020-09-08` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index 0cf177221..32a7ea67a 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,6 +10,31 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.10.7](https://github.com/youzan/vant/compare/v2.10.6...v2.10.7) + +`2020-09-17` + +**Feature** + +- Slider: 新增 range 属性,用于开启双滑块模式 [#7176](https://github.com/youzan/vant/issues/7176) +- Button: 新增 icon-position 属性,用于指定图标位置 [#7174](https://github.com/youzan/vant/issues/7174) + +**style** + +- Dialog: 优化无标题弹窗的最小高度 [#7191](https://github.com/youzan/vant/issues/7191) +- Field: 占位文字的颜色调整为 gray-6 [#7192](https://github.com/youzan/vant/issues/7192) +- TabbarItem: 新增 @tabbar-item-active-background-color less 变量 [#7162](https://github.com/youzan/vant/issues/7162) + +**Bug Fixes** + +- Calendar: 修复使用 rem 布局时内容跳动的问题 [#7190](https://github.com/youzan/vant/issues/7190) +- ImagePreview: 修复在个别场景下图片滑动范围错误的问题 [#7142](https://github.com/youzan/vant/issues/7142) +- NoticeBar: 修复在 safari 浏览器上返回时无法滚动的问题 [#7167](https://github.com/youzan/vant/issues/7167) +- NumberKeyboard: 修复 extra-key 包含多个字符时被截断的问题 [#7150](https://github.com/youzan/vant/issues/7150) +- NumberKeyboard: 修复 extra-key 插槽内无法触发 click 事件的问题 [#7193](https://github.com/youzan/vant/issues/7193) +- Tabs: 修复 offset-top 属性包含单位时切换标签后滚动位置错误的问题 [#7143](https://github.com/youzan/vant/issues/7143) +- Tag: 修复标签文字在小米手机上不居中的问题 [#7151](https://github.com/youzan/vant/issues/7151) + ### [v2.10.6](https://github.com/youzan/vant/compare/v2.10.5...v2.10.6) `2020-09-08` From adccdbcb21a26a31067fa8ded83caffbfc36a17d Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 17 Sep 2020 11:37:30 +0800 Subject: [PATCH 6/6] docs(Slider): update demo --- src/slider/README.md | 27 ++++++++--------- src/slider/README.zh-CN.md | 29 +++++++++---------- src/slider/demo/index.vue | 17 +++++------ .../test/__snapshots__/demo.spec.js.snap | 8 ++--- 4 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/slider/README.md b/src/slider/README.md index 594fbac21..852935fba 100644 --- a/src/slider/README.md +++ b/src/slider/README.md @@ -109,18 +109,15 @@ export default { ### Vertical ```html -
- -
-``` - -### Vertical, Dual thumb mode - -Add `range` and `vertical` attributes at the same time, and make sure that the value of `value` is an array - -```html -
- +
+ +
``` @@ -130,8 +127,8 @@ import { Toast } from 'vant'; export default { data() { return { - // value must be an array - value: [10, 50], + value: 50, + value2: [10, 50], }; }, methods: { @@ -151,12 +148,12 @@ export default { | value | Current value | _number \| array_ | `0` | | max | Max value | _number \| string_ | `100` | | min | Min value | _number \| string_ | `0` | -| range | Dual thumb mode | _boolean_ | `false` | | step | Step size | _number \| string_ | `1` | | bar-height | Height of bar | _number \| string_ | `2px` | | button-size `v2.4.5` | Button size | _number \| string_ | `24px` | | active-color | Active color of bar | _string_ | `#1989fa` | | inactive-color | Inactive color of bar | _string_ | `#e5e5e5` | +| range `v2.10.7` | Whether to enable dual thumb mode | _boolean_ | `false` | | disabled | Whether to disable slider | _boolean_ | `false` | | vertical | Whether to display slider vertically | _boolean_ | `false` | diff --git a/src/slider/README.zh-CN.md b/src/slider/README.zh-CN.md index bfbec503d..6fb00719f 100644 --- a/src/slider/README.zh-CN.md +++ b/src/slider/README.zh-CN.md @@ -108,21 +108,18 @@ export default { ### 垂直方向 -Slider 垂直展示时,高度为 100% 父元素高度 +设置 `vertical` 属性后,滑块会垂直展示,且高度为 100% 父元素高度。 ```html -
- -
-``` - -### 垂直方向,双滑块 - -同时添加`range`和`vertical`属性,并确保`value`的值是一个数组 - -```html -
- +
+ +
``` @@ -132,8 +129,8 @@ import { Toast } from 'vant'; export default { data() { return { - // 双滑块模式时,值必须是数组 - value: [10, 50], + value: 50, + value2: [10, 50], }; }, methods: { @@ -153,12 +150,12 @@ export default { | value | 当前进度百分比 | _number \| array_ | `0` | | max | 最大值 | _number \| string_ | `100` | | min | 最小值 | _number \| string_ | `0` | -| range | 双滑块模式 | _boolean_ | `false` | | step | 步长 | _number \| string_ | `1` | | bar-height | 进度条高度,默认单位为`px` | _number \| string_ | `2px` | | button-size `v2.4.5` | 滑块按钮大小,默认单位为`px` | _number \| string_ | `24px` | | active-color | 进度条激活态颜色 | _string_ | `#1989fa` | | inactive-color | 进度条非激活态颜色 | _string_ | `#e5e5e5` | +| range `v2.10.7` | 是否开启双滑块模式 | _boolean_ | `false` | | disabled | 是否禁用滑块 | _boolean_ | `false` | | vertical | 是否垂直展示 | _boolean_ | `false` | diff --git a/src/slider/demo/index.vue b/src/slider/demo/index.vue index 98c460bf6..3a33fa83a 100644 --- a/src/slider/demo/index.vue +++ b/src/slider/demo/index.vue @@ -38,14 +38,15 @@ -
+
-
- - - -
- +
@@ -64,7 +65,6 @@ export default { customButton: '自定义按钮', text: '当前值:', vertical: '垂直方向', - vertical2: '垂直方向,双滑块', }, 'en-US': { title1: 'Basic Usage', @@ -76,7 +76,6 @@ export default { customButton: 'Custom Button', text: 'Current value: ', vertical: 'Vertical', - vertical2: 'Vertical, Dual thumb mode', }, }, data() { diff --git a/src/slider/test/__snapshots__/demo.spec.js.snap b/src/slider/test/__snapshots__/demo.spec.js.snap index 1e4852582..568a82e25 100644 --- a/src/slider/test/__snapshots__/demo.spec.js.snap +++ b/src/slider/test/__snapshots__/demo.spec.js.snap @@ -69,7 +69,7 @@ exports[`renders demo correctly 1`] = `
-
+
@@ -77,11 +77,7 @@ exports[`renders demo correctly 1`] = `
-
-
-
-
-
+