From f9a7da54c59ae380054edb7410b0d4e7868afbda Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2020 11:14:18 +0800 Subject: [PATCH 01/13] fix(AddressEdit): incorrect label wrap on safari (#6969) --- src/address-edit/index.less | 2 +- src/style/var.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/address-edit/index.less b/src/address-edit/index.less index df3f27f5f..80f26f9fe 100644 --- a/src/address-edit/index.less +++ b/src/address-edit/index.less @@ -8,7 +8,7 @@ border-radius: @padding-xs; .van-field__label { - width: 4em; + width: 4.1em; } } diff --git a/src/style/var.less b/src/style/var.less index a3f86003c..5fae8ef3e 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -255,7 +255,7 @@ @contact-edit-buttons-padding: @padding-xl 0; @contact-edit-button-margin-bottom: @padding-sm; @contact-edit-button-font-size: 16px; -@contact-edit-field-label-width: 4em; +@contact-edit-field-label-width: 4.1em; // ContactList @contact-list-edit-icon-size: 16px; From c2a3f6411e4b950f39d1815923b851f479c661e3 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2020 11:21:53 +0800 Subject: [PATCH 02/13] style(ContactList): add safe area inset bottom (#6970) --- src/address-list/index.less | 1 - src/contact-list/index.less | 8 +++++--- src/style/var.less | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/address-list/index.less b/src/address-list/index.less index 27d2b2e41..68eceeb39 100644 --- a/src/address-list/index.less +++ b/src/address-list/index.less @@ -21,7 +21,6 @@ &__add { height: 40px; margin: 5px 0; - line-height: 38px; } &__disabled-text { diff --git a/src/contact-list/index.less b/src/contact-list/index.less index 2a6058c0c..90aa431c6 100644 --- a/src/contact-list/index.less +++ b/src/contact-list/index.less @@ -3,7 +3,7 @@ .van-contact-list { box-sizing: border-box; height: 100%; - padding-bottom: 50px; + padding-bottom: 80px; &__item { padding: @contact-list-item-padding; @@ -41,12 +41,14 @@ bottom: 0; left: 0; z-index: @contact-list-add-button-z-index; - padding: 5px 16px; + padding: 0 @padding-md; + padding-bottom: constant(safe-area-inset-bottom); + padding-bottom: env(safe-area-inset-bottom); background-color: @white; } &__add { height: 40px; - line-height: 38px; + margin: 5px 0; } } diff --git a/src/style/var.less b/src/style/var.less index 5fae8ef3e..6f5373a21 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -99,7 +99,7 @@ @address-edit-detail-finish-font-size: @font-size-sm; // AddressList -@address-list-padding: 12px 12px 100px; +@address-list-padding: @padding-sm @padding-sm 80px; @address-list-disabled-text-color: @gray-6; @address-list-disabled-text-padding: @padding-base * 5 0 @padding-md; @address-list-disabled-text-font-size: @font-size-md; From 684f2f41b9c824e20cd828a5f32b59e83285bffc Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2020 11:43:10 +0800 Subject: [PATCH 03/13] style(TabbarItem): increase icon size to 22px (#6972) --- src/style/var.less | 4 ++-- src/tabbar-item/index.less | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/style/var.less b/src/style/var.less index 6f5373a21..5563dc4df 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -754,8 +754,8 @@ @tabbar-item-text-color: @gray-7; @tabbar-item-active-color: @blue; @tabbar-item-line-height: 1; -@tabbar-item-icon-size: 18px; -@tabbar-item-margin-bottom: 5px; +@tabbar-item-icon-size: 22px; +@tabbar-item-margin-bottom: 4px; // Tab @tab-text-color: @gray-7; diff --git a/src/tabbar-item/index.less b/src/tabbar-item/index.less index da3a7fb37..da63a2fc3 100644 --- a/src/tabbar-item/index.less +++ b/src/tabbar-item/index.less @@ -23,7 +23,7 @@ img { display: block; - height: @tabbar-item-icon-size; + height: 20px; } } @@ -32,6 +32,6 @@ } .van-info { - margin-top: 2px; + margin-top: @padding-base; } } From eb9c758acf5e9ebf47f1692a1e0d9a6355fc4ea4 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 10 Aug 2020 15:55:03 +0800 Subject: [PATCH 04/13] fix(Icon): fix badge number align (#6975) * Revert "fix(Info): number vertical align center (#6952)" This reverts commit 3eb8e00843dc7f5cfcac40ffd0abb2e474573035. * style(Icon): fix badge number align * fix(Icon): line-height --- src/info/index.less | 1 + src/style/var.less | 1 + 2 files changed, 2 insertions(+) diff --git a/src/info/index.less b/src/info/index.less index 76e021325..10d9ce115 100644 --- a/src/info/index.less +++ b/src/info/index.less @@ -10,6 +10,7 @@ color: @info-color; font-weight: @info-font-weight; font-size: @info-font-size; + font-family: @info-font-family; line-height: 1.2; text-align: center; background-color: @info-background-color; diff --git a/src/style/var.less b/src/style/var.less index 5563dc4df..58c805910 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -419,6 +419,7 @@ @info-background-color: @red; @info-dot-color: @red; @info-dot-size: 8px; +@info-font-family: -apple-system-font, Helvetica Neue, Arial, sans-serif; // Image @image-placeholder-text-color: @gray-6; From d9a0eb07e7db235aa88e2d9911715f7619d56716 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 10 Aug 2020 21:01:02 +0800 Subject: [PATCH 05/13] chore: release 2.10.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a9925ea62..b24da4c1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.10.0", + "version": "2.10.1", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", From 750605db2bd0f84b70b393092a86117d935f5bcb Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 10 Aug 2020 21:08:21 +0800 Subject: [PATCH 06/13] docs(changelog): 2.10.1 --- docs/markdown/changelog.en-US.md | 19 +++++++++++++++++++ docs/markdown/changelog.zh-CN.md | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 18be4b66e..ed942cd3e 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -10,6 +10,25 @@ 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.1](https://github.com/youzan/vant/compare/v2.10.0...v2.10.1) + +`2020-08-10` + +**Feature** + +- Button: add loading slot [#6966](https://github.com/youzan/vant/issues/6966) +- Locale: adding Norwegian Language support [#6962](https://github.com/youzan/vant/issues/6962) + +**style** + +- ContactList: add safe area inset bottom [#6970](https://github.com/youzan/vant/issues/6970) +- TabbarItem: increase icon size to 22px [#6972](https://github.com/youzan/vant/issues/6972) + +**Bug Fixes** + +- AddressEdit: incorrect label wrap on safari [#6969](https://github.com/youzan/vant/issues/6969) +- Icon: fix badge number align [#6975](https://github.com/youzan/vant/issues/6975) [#6952](https://github.com/youzan/vant/issues/6952) + ### [v2.10.0](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0) `2020-08-07` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index b6df7cc37..81f9d8aee 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,6 +10,26 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.10.1](https://github.com/youzan/vant/compare/v2.10.0...v2.10.1) + +`2020-08-10` + +**Feature** + +- Button: 新增 loading 插槽 [#6966](https://github.com/youzan/vant/issues/6966) +- Locale: 新增挪威语语言包 [#6962](https://github.com/youzan/vant/issues/6962) + +**style** + +- ContactList: 适配 iOS 底部安全区 [#6970](https://github.com/youzan/vant/issues/6970) +- TabbarItem: 图标大小扩大为 22px [#6972](https://github.com/youzan/vant/issues/6972) + +**Bug Fixes** + +- AddressEdit: 修复在 safari 上左侧文字换行的问题 [#6969](https://github.com/youzan/vant/issues/6969) +- ContactEdit: 修复在 safari 上左侧文字换行的问题 [#6969](https://github.com/youzan/vant/issues/6969) +- Icon: 修复徽标数字不居中的问题 [#6975](https://github.com/youzan/vant/issues/6975) [#6952](https://github.com/youzan/vant/issues/6952) + ### [v2.10.0](https://github.com/youzan/vant/compare/v2.9.4...v2.10.0) `2020-08-07` From a1007fc324b236debe967dcf4fac3bc2c231ccfe Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 11 Aug 2020 19:25:11 +0800 Subject: [PATCH 07/13] docs(Area): update area.js (#6984) --- src/area/demo/area.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/area/demo/area.js b/src/area/demo/area.js index d2102bb5d..61a091e4c 100644 --- a/src/area/demo/area.js +++ b/src/area/demo/area.js @@ -4035,7 +4035,13 @@ export default { 810307: '荃湾区', 810308: '葵青区', 810309: '离岛区', - 820101: '澳门半岛', - 820201: '离岛', + 820102: '花地玛堂区', + 820103: '花王堂区', + 820104: '望德堂区', + 820105: '大堂区', + 820106: '风顺堂区', + 820202: '嘉模堂区', + 820203: '路氹填海区', + 820204: '圣方济各堂区', }, }; From 12365051fccdb0cd32f454b388556b0d55883b86 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 11 Aug 2020 20:51:01 +0800 Subject: [PATCH 08/13] feat(Tab): add @tab-line-height less var (#6985) --- src/style/var.less | 1 + src/tabs/index.less | 1 + 2 files changed, 2 insertions(+) diff --git a/src/style/var.less b/src/style/var.less index 58c805910..6f64feb27 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -763,6 +763,7 @@ @tab-active-text-color: @text-color; @tab-disabled-text-color: @gray-5; @tab-font-size: @font-size-md; +@tab-line-height: @line-height-md; // Tabs @tabs-default-color: @red; diff --git a/src/tabs/index.less b/src/tabs/index.less index 062f6ab62..aa4aca4b5 100644 --- a/src/tabs/index.less +++ b/src/tabs/index.less @@ -10,6 +10,7 @@ padding: 0 @padding-base; color: @tab-text-color; font-size: @tab-font-size; + line-height: @tab-line-height; cursor: pointer; &--active { From 5754a8a10be9fe79d1162b8ed8466098428b390a Mon Sep 17 00:00:00 2001 From: landluck Date: Wed, 12 Aug 2020 14:01:10 +0800 Subject: [PATCH 09/13] fix(Sku): compatible sku.list don't exist (#6991) Co-authored-by: liuhaihong --- src/sku/Sku.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sku/Sku.js b/src/sku/Sku.js index 2c269538a..230c26191 100644 --- a/src/sku/Sku.js +++ b/src/sku/Sku.js @@ -200,7 +200,7 @@ export default createComponent({ let skuComb = null; if (this.isSkuCombSelected) { if (this.hasSku) { - skuComb = getSkuComb(this.sku.list, this.selectedSku); + skuComb = getSkuComb(this.skuList, this.selectedSku); } else { skuComb = { id: this.sku.collection_id, @@ -257,6 +257,10 @@ export default createComponent({ return this.sku.tree || []; }, + skuList() { + return this.sku.list || []; + }, + propList() { return this.properties || []; }, @@ -384,7 +388,7 @@ export default createComponent({ item.v.length === 1 ? item.v[0].id : this.initialSku[key]; if ( valueId && - isSkuChoosable(this.sku.list, this.selectedSku, { key, valueId }) + isSkuChoosable(this.skuList, this.selectedSku, { key, valueId }) ) { this.selectedSku[key] = valueId; } @@ -639,6 +643,7 @@ export default createComponent({ const { sku, + skuList, goods, price, lazyLoad, @@ -709,7 +714,7 @@ export default createComponent({ {skuTreeItem.v.map((skuValue) => ( Date: Wed, 12 Aug 2020 14:09:30 +0800 Subject: [PATCH 10/13] chore: release 2.10.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b24da4c1d..a6480f8ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.10.1", + "version": "2.10.2", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", From 3c44b5acd9c6089b6b6b60f465496705ed7a1348 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 12 Aug 2020 14:20:19 +0800 Subject: [PATCH 11/13] docs(changelog): 2.10.2 --- docs/markdown/changelog.en-US.md | 12 ++++++++++++ docs/markdown/changelog.zh-CN.md | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index ed942cd3e..82afd16ea 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -10,6 +10,18 @@ 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.2](https://github.com/youzan/vant/compare/v2.10.1...v2.10.2) + +`2020-08-12` + +**Feature** + +- Tab: add @tab-line-height less var [#6985](https://github.com/youzan/vant/issues/6985) + +**Bug Fixes** + +- Sku: compatible sku.list don't exist [#6991](https://github.com/youzan/vant/issues/6991) + ### [v2.10.1](https://github.com/youzan/vant/compare/v2.10.0...v2.10.1) `2020-08-10` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index 81f9d8aee..01d71b3b3 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -10,6 +10,18 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 次版本号:每隔一至二个月发布,包含新特性和较大的功能更新,向下兼容。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.10.2](https://github.com/youzan/vant/compare/v2.10.1...v2.10.2) + +`2020-08-12` + +**Feature** + +- Tab: 新增 @tab-line-height less 变量 [#6985](https://github.com/youzan/vant/issues/6985) + +**Bug Fixes** + +- Sku: 适配 sku.list 为空导致报错的问题 [#6991](https://github.com/youzan/vant/issues/6991) + ### [v2.10.1](https://github.com/youzan/vant/compare/v2.10.0...v2.10.1) `2020-08-10` From 4f9eeec75216a5953845ff7434ce03f8c1e125ce Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 13 Aug 2020 20:50:53 +0800 Subject: [PATCH 12/13] style(Tabs): adjust default line-width to 40px (#7002) --- .../test/__snapshots__/demo.spec.js.snap | 2 +- .../test/__snapshots__/demo.spec.js.snap | 2 +- src/list/test/__snapshots__/demo.spec.js.snap | 2 +- .../test/__snapshots__/demo.spec.js.snap | 2 +- src/style/var.less | 1 + src/tab/README.md | 2 +- src/tab/README.zh-CN.md | 4 ++-- src/tab/test/__snapshots__/demo.spec.js.snap | 22 +++++++++---------- src/tab/test/__snapshots__/index.spec.js.snap | 10 ++++----- .../test/__snapshots__/insert.spec.js.snap | 2 +- src/tabs/index.js | 3 +-- src/tabs/index.less | 1 + 12 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/empty/test/__snapshots__/demo.spec.js.snap b/src/empty/test/__snapshots__/demo.spec.js.snap index 438b1aa9b..0537f43af 100644 --- a/src/empty/test/__snapshots__/demo.spec.js.snap +++ b/src/empty/test/__snapshots__/demo.spec.js.snap @@ -15,7 +15,7 @@ exports[`renders demo correctly 1`] = ` -
+
diff --git a/src/index-bar/test/__snapshots__/demo.spec.js.snap b/src/index-bar/test/__snapshots__/demo.spec.js.snap index a0fb3099c..caa480f26 100644 --- a/src/index-bar/test/__snapshots__/demo.spec.js.snap +++ b/src/index-bar/test/__snapshots__/demo.spec.js.snap @@ -7,7 +7,7 @@ exports[`renders demo correctly 1`] = `
-
+
diff --git a/src/list/test/__snapshots__/demo.spec.js.snap b/src/list/test/__snapshots__/demo.spec.js.snap index 9d73814a2..6ecfc6f12 100644 --- a/src/list/test/__snapshots__/demo.spec.js.snap +++ b/src/list/test/__snapshots__/demo.spec.js.snap @@ -8,7 +8,7 @@ exports[`renders demo correctly 1`] = ` -
+
diff --git a/src/pull-refresh/test/__snapshots__/demo.spec.js.snap b/src/pull-refresh/test/__snapshots__/demo.spec.js.snap index e7f59b83c..ab7e8350b 100644 --- a/src/pull-refresh/test/__snapshots__/demo.spec.js.snap +++ b/src/pull-refresh/test/__snapshots__/demo.spec.js.snap @@ -8,7 +8,7 @@ exports[`renders demo correctly 1`] = ` -
+
diff --git a/src/style/var.less b/src/style/var.less index 6f64feb27..a40138923 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -770,6 +770,7 @@ @tabs-line-height: 44px; @tabs-card-height: 30px; @tabs-nav-background-color: @white; +@tabs-bottom-bar-width: 40px; @tabs-bottom-bar-height: 3px; @tabs-bottom-bar-color: @tabs-default-color; diff --git a/src/tab/README.md b/src/tab/README.md index ca954b084..1c1d7f17a 100644 --- a/src/tab/README.md +++ b/src/tab/README.md @@ -224,7 +224,7 @@ export default { | color | Tab color | _string_ | `#ee0a24` | | background | Background color | _string_ | `white` | | duration | Toggle tab's animation time | _number \| string_ | `0.3` | - | -| line-width | Width of tab line | _number \| string_ | Width of active tab | +| line-width | Width of tab line | _number \| string_ | `40px` | | line-height | Height of tab line | _number \| string_ | `3px` | | animated | Whether to change tabs with animation | _boolean_ | `false` | | border | Whether to show border when `type="line"` | _boolean_ | `false` | diff --git a/src/tab/README.zh-CN.md b/src/tab/README.zh-CN.md index 162c7c152..aecbc8430 100644 --- a/src/tab/README.zh-CN.md +++ b/src/tab/README.zh-CN.md @@ -231,8 +231,8 @@ export default { | color | 标签主题色 | _string_ | `#ee0a24` | | background | 标签栏背景色 | _string_ | `white` | | duration | 动画时间,单位秒 | _number \| string_ | `0.3` | -| line-width | 底部条宽度,默认单位`px` | _number \| string_ | `auto` | -| line-height | 底部条高度,默认单位`px` | _number \| string_ | `3px` | +| line-width | 底部条宽度,默认单位 `px` | _number \| string_ | `40px` | +| line-height | 底部条高度,默认单位 `px` | _number \| string_ | `3px` | | animated | 是否开启切换标签内容时的转场动画 | _boolean_ | `false` | | border | 是否显示标签栏外边框,仅在 `type="line"` 时有效 | _boolean_ | `false` | | ellipsis | 是否省略过长的标题文字 | _boolean_ | `true` | diff --git a/src/tab/test/__snapshots__/demo.spec.js.snap b/src/tab/test/__snapshots__/demo.spec.js.snap index b63592ce1..1a4709130 100644 --- a/src/tab/test/__snapshots__/demo.spec.js.snap +++ b/src/tab/test/__snapshots__/demo.spec.js.snap @@ -10,7 +10,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -36,7 +36,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -62,7 +62,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -100,7 +100,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -144,7 +144,7 @@ exports[`renders demo correctly 1`] = `
-
+
@@ -167,7 +167,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -194,7 +194,7 @@ exports[`renders demo correctly 1`] = `
-
+
@@ -215,7 +215,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -252,7 +252,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -285,7 +285,7 @@ exports[`renders demo correctly 1`] = ` -
+
@@ -326,7 +326,7 @@ exports[`renders demo correctly 1`] = ` -
+
diff --git a/src/tab/test/__snapshots__/index.spec.js.snap b/src/tab/test/__snapshots__/index.spec.js.snap index 7efa84ec6..93627890c 100644 --- a/src/tab/test/__snapshots__/index.spec.js.snap +++ b/src/tab/test/__snapshots__/index.spec.js.snap @@ -65,7 +65,7 @@ exports[`click to switch tab 1`] = ` -
+
@@ -87,7 +87,7 @@ exports[`click to switch tab 2`] = ` -
+
@@ -187,7 +187,7 @@ exports[`name prop 1`] = ` -
+
@@ -238,7 +238,7 @@ exports[`scrollspy prop 1`] = ` -
+
@@ -260,7 +260,7 @@ exports[`scrollspy prop 2`] = ` -
+
diff --git a/src/tab/test/__snapshots__/insert.spec.js.snap b/src/tab/test/__snapshots__/insert.spec.js.snap index ba009f874..15b4c1272 100644 --- a/src/tab/test/__snapshots__/insert.spec.js.snap +++ b/src/tab/test/__snapshots__/insert.spec.js.snap @@ -7,7 +7,7 @@ exports[`insert tab dynamically 1`] = ` -
+
diff --git a/src/tabs/index.js b/src/tabs/index.js index 00f3383f5..69a7c9b96 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -204,11 +204,10 @@ export default createComponent({ const title = titles[this.currentIndex].$el; const { lineWidth, lineHeight } = this; - const width = isDef(lineWidth) ? lineWidth : title.offsetWidth / 2; const left = title.offsetLeft + title.offsetWidth / 2; const lineStyle = { - width: addUnit(width), + width: addUnit(lineWidth), backgroundColor: this.color, transform: `translateX(${left}px) translateX(-50%)`, }; diff --git a/src/tabs/index.less b/src/tabs/index.less index aa4aca4b5..b4e1a54c0 100644 --- a/src/tabs/index.less +++ b/src/tabs/index.less @@ -119,6 +119,7 @@ bottom: 15px; left: 0; z-index: 1; + width: @tabs-bottom-bar-width; height: @tabs-bottom-bar-height; background-color: @tabs-bottom-bar-color; border-radius: @tabs-bottom-bar-height; From b6e42d234458f34a1fc3890dc8072e56a40e900b Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 14 Aug 2020 20:27:02 +0800 Subject: [PATCH 13/13] docs(Dialog): update demo (#7007) --- src/dialog/README.md | 34 +++++----- src/dialog/README.zh-CN.md | 34 +++++----- src/dialog/demo/index.vue | 45 +++--------- .../test/__snapshots__/demo.spec.js.snap | 68 ++++++++++--------- 4 files changed, 80 insertions(+), 101 deletions(-) diff --git a/src/dialog/README.md b/src/dialog/README.md index c7fed18ab..1094e665d 100644 --- a/src/dialog/README.md +++ b/src/dialog/README.md @@ -30,6 +30,23 @@ Dialog.alert({ }); ``` +### Confirm dialog + +Used to confirm some messages, including a confirm button and a cancel button. + +```js +Dialog.confirm({ + title: 'Title', + message: 'Content', +}) + .then(() => { + // on confirm + }) + .catch(() => { + // on cancel + }); +``` + ### Round Button Style Use round button style. @@ -51,23 +68,6 @@ Dialog.alert({ }); ``` -### Confirm dialog - -Used to confirm some messages, including a confirm button and a cancel button. - -```js -Dialog.confirm({ - title: 'Title', - message: 'Content', -}) - .then(() => { - // on confirm - }) - .catch(() => { - // on cancel - }); -``` - ### Asnyc Close ```js diff --git a/src/dialog/README.zh-CN.md b/src/dialog/README.zh-CN.md index 67818beda..07272b14a 100644 --- a/src/dialog/README.zh-CN.md +++ b/src/dialog/README.zh-CN.md @@ -56,6 +56,23 @@ Dialog.alert({ }); ``` +### 消息确认 + +用于确认消息,包含取消和确认按钮。 + +```js +Dialog.confirm({ + title: '标题', + message: '弹窗内容', +}) + .then(() => { + // on confirm + }) + .catch(() => { + // on cancel + }); +``` + ### 圆角按钮风格 将 theme 选项设置为 `round-button` 可以展示圆角按钮风格的弹窗,该选项从 2.10.0 版本开始支持。 @@ -77,23 +94,6 @@ Dialog.alert({ }); ``` -### 消息确认 - -用于确认消息,包含取消和确认按钮。 - -```js -Dialog.confirm({ - title: '标题', - message: '弹窗内容', -}) - .then(() => { - // on confirm - }) - .catch(() => { - // on cancel - }); -``` - ### 异步关闭 通过 `beforeClose` 属性可以传入一个回调函数,在弹窗关闭前进行特定操作。 diff --git a/src/dialog/demo/index.vue b/src/dialog/demo/index.vue index 4c5d0dbb4..25c659597 100644 --- a/src/dialog/demo/index.vue +++ b/src/dialog/demo/index.vue @@ -1,39 +1,22 @@