From 31d645959dc4e494593fed1e23c8e049a8d26b16 Mon Sep 17 00:00:00 2001 From: Waiter Date: Thu, 5 Dec 2019 19:30:06 +0800 Subject: [PATCH 1/8] fix(Sku): stepper value must be integer (#5202) --- src/sku/components/SkuStepper.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sku/components/SkuStepper.js b/src/sku/components/SkuStepper.js index dcaa9de55..e8fd20226 100644 --- a/src/sku/components/SkuStepper.js +++ b/src/sku/components/SkuStepper.js @@ -41,7 +41,8 @@ export default createComponent({ watch: { currentNum(num) { - this.skuEventBus.$emit('sku:numChange', num); + const intValue = parseInt(num, 10); + this.skuEventBus.$emit('sku:numChange', intValue); }, stepperLimit(limit) { @@ -122,9 +123,10 @@ export default createComponent({ }, onChange(currentValue) { + const intValue = parseInt(currentValue, 10); const { handleStepperChange } = this.customStepperConfig; - handleStepperChange && handleStepperChange(currentValue); - this.$emit('change', currentValue); + handleStepperChange && handleStepperChange(intValue); + this.$emit('change', intValue); }, checkState(min, max) { @@ -159,6 +161,7 @@ export default createComponent({ min={this.stepperMinLimit} max={this.stepperLimit} disableInput={this.disableStepperInput} + integer onOverlimit={this.onOverLimit} onChange={this.onChange} /> From 04bfb76d6388c907bf3c5bb320aa8460686a1fc0 Mon Sep 17 00:00:00 2001 From: Lindy <33708359+Lindysen@users.noreply.github.com> Date: Fri, 6 Dec 2019 11:34:14 +0800 Subject: [PATCH 2/8] fix(Card): fix price font-family (#5194) --- src/card/index.less | 13 +++++++---- src/card/index.tsx | 22 +++++++++++++------ src/card/test/__snapshots__/demo.spec.js.snap | 6 ++--- src/style/var.less | 3 ++- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/card/index.less b/src/card/index.less index 86df44a08..d9bbedee6 100644 --- a/src/card/index.less +++ b/src/card/index.less @@ -64,11 +64,16 @@ display: inline-block; color: @card-price-color; font-weight: @font-weight-bold; + font-size: @card-price-font-size; + } - &--integer { - font-size: @card-price-integer-font-size; - font-family: @card-price-font-family; - } + &__price-integer { + font-size: @card-price-integer-font-size; + font-family: @card-price-font-family; + } + + &__price-decimal { + font-family: @card-price-font-family; } &__origin-price { diff --git a/src/card/index.tsx b/src/card/index.tsx index 2dc3cc48e..bb34138a9 100644 --- a/src/card/index.tsx +++ b/src/card/index.tsx @@ -101,7 +101,11 @@ function Card( } if (props.title) { - return
{props.title}
; + return ( +
+ {props.title} +
+ ); } } @@ -118,11 +122,11 @@ function Card( function PriceContent() { const priceArr = props.price!.toString().split('.'); return ( -
- {props.currency} - {priceArr[0]}. - {priceArr[1]} -
+
+ {props.currency} + {priceArr[0]}. + {priceArr[1]} +
); } @@ -149,7 +153,11 @@ function Card( function Num() { if (showNum) { - return
{slots.num ? slots.num() : `x${props.num}`}
; + return ( +
+ {slots.num ? slots.num() : `x${props.num}`} +
+ ); } } diff --git a/src/card/test/__snapshots__/demo.spec.js.snap b/src/card/test/__snapshots__/demo.spec.js.snap index 77352ba68..fe11d3433 100644 --- a/src/card/test/__snapshots__/demo.spec.js.snap +++ b/src/card/test/__snapshots__/demo.spec.js.snap @@ -17,7 +17,7 @@ exports[`renders demo correctly 1`] = `
-
¥2.00
+
¥2.00
x2
@@ -41,7 +41,7 @@ exports[`renders demo correctly 1`] = `
-
¥2.00
+
¥2.00
¥ 10.00
x2
@@ -70,7 +70,7 @@ exports[`renders demo correctly 1`] = `
-
¥2.00
+
¥2.00
x2
diff --git a/src/style/var.less b/src/style/var.less index fc6ba8556..cba87fc95 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -42,7 +42,7 @@ @font-size-md: 14px; @font-size-lg: 16px; @font-weight-bold: 500; -@price-integer-font-family: Avenir-Heavy PingFang SC, Helvetica Neue, Arial, sans-serif; +@price-integer-font-family: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial, sans-serif; // Animation @animation-duration-base: .3s; @@ -148,6 +148,7 @@ @card-origin-price-color: @gray-6; @card-num-color: @gray-6; @card-origin-price-font-size: @font-size-xs; +@card-price-font-size: @font-size-sm; @card-price-integer-font-size: @font-size-lg; @card-price-font-family: @price-integer-font-family; From c45a08feadf8788b18db7af2f7aa5274af855402 Mon Sep 17 00:00:00 2001 From: rex Date: Fri, 6 Dec 2019 11:34:49 +0800 Subject: [PATCH 3/8] feat(AddressList): adjust less variable @address-list-padding (#5204) --- 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 cba87fc95..fd68382b6 100644 --- a/src/style/var.less +++ b/src/style/var.less @@ -84,7 +84,7 @@ @address-edit-detail-finish-font-size: @font-size-sm; // AddressList -@address-list-padding: 12px 7px 100px 17px; +@address-list-padding: 12px 12px 100px; @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 47c3d61584de4418aaa1ec481ef297d2ad8bf217 Mon Sep 17 00:00:00 2001 From: Waiter Date: Fri, 6 Dec 2019 16:57:05 +0800 Subject: [PATCH 4/8] fix(Sku): stepper emit valid num (#5210) --- src/sku/components/SkuStepper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sku/components/SkuStepper.js b/src/sku/components/SkuStepper.js index e8fd20226..55c9a1eb4 100644 --- a/src/sku/components/SkuStepper.js +++ b/src/sku/components/SkuStepper.js @@ -42,7 +42,9 @@ export default createComponent({ watch: { currentNum(num) { const intValue = parseInt(num, 10); - this.skuEventBus.$emit('sku:numChange', intValue); + if (intValue >= this.stepperMinLimit && intValue <= this.stepperLimit) { + this.skuEventBus.$emit('sku:numChange', intValue); + } }, stepperLimit(limit) { From 7ec427c1459884894de104addf6bf393ecd4cfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 6 Dec 2019 17:01:32 +0800 Subject: [PATCH 5/8] docs(Notify): fix incorrect type --- packages/vant-cli/src/index.js | 0 src/notify/README.md | 2 +- src/notify/README.zh-CN.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 packages/vant-cli/src/index.js diff --git a/packages/vant-cli/src/index.js b/packages/vant-cli/src/index.js old mode 100644 new mode 100755 diff --git a/src/notify/README.md b/src/notify/README.md index daf20ed92..94153c38e 100644 --- a/src/notify/README.md +++ b/src/notify/README.md @@ -68,7 +68,7 @@ export default { | Attribute | Description | Type | Default | Version | |------|------|------|------|------| -| type | Can be set to `primary` `info` `warning` | *string* | `danger` | 2.1.6 | +| type | Can be set to `primary` `success` `warning` | *string* | `danger` | 2.1.6 | | message | Message | *string* | - | - | | duration | Duration(ms), won't disappear if value is 0 | *number* | `3000` | - | | color | Message color | *string* | `#fff` | | - | diff --git a/src/notify/README.zh-CN.md b/src/notify/README.zh-CN.md index 1c3afe69c..7a3f583ae 100644 --- a/src/notify/README.zh-CN.md +++ b/src/notify/README.zh-CN.md @@ -79,7 +79,7 @@ export default { | 参数 | 说明 | 类型 | 默认值 | 版本 | |------|------|------|------|------| -| type | 类型,可选值为 `primary` `info` `warning` | *string* | `danger` | 2.1.6 | +| type | 类型,可选值为 `primary` `success` `warning` | *string* | `danger` | 2.1.6 | | message | 展示文案,支持通过`\n`换行 | *string* | - | - | | duration | 展示时长(ms),值为 0 时,notify 不会消失 | *number* | `3000` | - | | color | 字体颜色 | *string* | `#fff` | - | From d53a65600b14805cc81bf048a1d9f477d275bc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 6 Dec 2019 17:02:48 +0800 Subject: [PATCH 6/8] build: release 2.3.0-beta.2 --- package.json | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c1e69fabf..cb4680e2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vant", - "version": "2.3.0-beta.1", + "version": "2.3.0-beta.2", "description": "Mobile UI Components built on Vue", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/index.ts b/src/index.ts index 9cba2e473..019db445e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -89,7 +89,7 @@ declare global { } } -const version = '2.3.0-beta.1'; +const version = '2.3.0-beta.2'; const components = [ ActionSheet, AddressEdit, From 650e479313fda9815d73250c5405884d37c3c9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Sat, 7 Dec 2019 08:51:58 +0800 Subject: [PATCH 7/8] docs(changelog): 2.3.0-beta.2 --- docs/markdown/changelog.en-US.md | 30 ++++++++++++++++++++++++++++-- docs/markdown/changelog.zh-CN.md | 28 +++++++++++++++++++++++++++- src/address-list/README.md | 2 +- src/address-list/README.zh-CN.md | 2 +- src/contact-card/README.md | 6 +++--- src/contact-card/README.zh-CN.md | 6 +++--- src/coupon-list/README.md | 2 +- src/coupon-list/README.zh-CN.md | 2 +- src/sku/README.md | 2 +- src/sku/README.zh-CN.md | 2 +- src/submit-bar/README.md | 2 +- src/submit-bar/README.zh-CN.md | 2 +- 12 files changed, 69 insertions(+), 17 deletions(-) diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 212c991c0..4c5e15289 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -1,5 +1,31 @@ # Changelog +### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2) +`2019-12-06` + +**Style** + +Upgrading the style of business components: + +- CouponList + +**Features** + +- CouponList: add show-count prop [\#5139](https://github.com/youzan/vant/pull/5139) + +**Bug Fixes** + +- fix Sku stepper value must be integer [\#5202](https://github.com/youzan/vant/pull/5202) +- fix Sku stepper should not emit invalid num [\#5210](https://github.com/youzan/vant/pull/5210) +- fix Card incorrect price font-family [\#5194](https://github.com/youzan/vant/pull/5194) +- fix AddressList incorrect horizontal padding [\#5204](https://github.com/youzan/vant/pull/5204) +- fix Picker should not submit form [\#5182](https://github.com/youzan/vant/pull/5182) +- fix Stepper should not submit form [\#5183](https://github.com/youzan/vant/pull/5183) +- fix ActionSheet should not submit form [\#5181](https://github.com/youzan/vant/pull/5181) +- fix Uploader not trigger oversize event when upload same file [\#5177](https://github.com/youzan/vant/pull/5177) +- fix less import issue [\#5157](https://github.com/youzan/vant/pull/5157) + + ### [v2.3.0-beta.1](https://github.com/youzan/vant/tree/v2.3.0-beta.1) `2019-11-30` @@ -19,11 +45,11 @@ Upgrading the style of business components: - Card: add price-top slot [\#5134](https://github.com/youzan/vant/pull/5134) - Circle: add stroke-linecap prop [\#5087](https://github.com/youzan/vant/pull/5087) - CountDown: support SS and S format [\#5154](https://github.com/youzan/vant/pull/5154) -- Sku: add new startSaleNum prop [\#5105](https://github.com/youzan/vant/pull/5105) +- Sku: add new start-sale-num prop [\#5105](https://github.com/youzan/vant/pull/5105) - SubmitBar: add text-align prop [\#5130](https://github.com/youzan/vant/pull/5130) - AddressList: add default-tag-text prop [\#5106](https://github.com/youzan/vant/pull/5106) - ContactList: add default-tag-text prop [\#5089](https://github.com/youzan/vant/pull/5089) -- ContactCard: add show-set-default prop [\#5083](https://github.com/youzan/vant/pull/5083) +- ContactCard: add show-set-default、set-default-label prop [\#5083](https://github.com/youzan/vant/pull/5083) - Toast: improve type definitions [\#5086](https://github.com/youzan/vant/pull/5086) **Bug Fixes** diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index b998447d2..0ba5ea697 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -11,6 +11,32 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - 主版本号:发布时间不定,包含不兼容更新,预计下一个主版本会与 Vue 3.0 同期发布。 +### [v2.3.0-beta.2](https://github.com/youzan/vant/tree/v2.3.0-beta.2) +`2019-12-06` + +**Style** + +升级以下业务组件的样式: + +- CouponList + +**Features** + +- CouponList: 新增 show-count 属性 [\#5139](https://github.com/youzan/vant/pull/5139) + +**Bug Fixes** + +- 修复 Sku 步进器可能输入小数的问题 [\#5202](https://github.com/youzan/vant/pull/5202) +- 修复 Sku 步进器事件可能抛出小数的问题 [\#5210](https://github.com/youzan/vant/pull/5210) +- 修复 Card 价格字体错误的问题 [\#5194](https://github.com/youzan/vant/pull/5194) +- 修复 AddressList 左右边距错误的问题 [\#5204](https://github.com/youzan/vant/pull/5204) +- 修复 Picker 按钮会提交表单的问题 [\#5182](https://github.com/youzan/vant/pull/5182) +- 修复 Stepper 按钮会提交表单的问题 [\#5183](https://github.com/youzan/vant/pull/5183) +- 修复 ActionSheet 按钮会提交表单的问题 [\#5181](https://github.com/youzan/vant/pull/5181) +- 修复 Uploader 重复上传同张图片时不会触发 oversize 事件的问题 [\#5177](https://github.com/youzan/vant/pull/5177) +- 修复主题定制时使用低版本 Less 会报错的问题 [\#5157](https://github.com/youzan/vant/pull/5157) + + ### [v2.3.0-beta.1](https://github.com/youzan/vant/tree/v2.3.0-beta.1) `2019-11-30` @@ -34,7 +60,7 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 - SubmitBar: 新增 text-align 属性 [\#5130](https://github.com/youzan/vant/pull/5130) - AddressList: 新增 default-tag-text 属性 [\#5106](https://github.com/youzan/vant/pull/5106) - ContactList: 新增 default-tag-text 属性 [\#5089](https://github.com/youzan/vant/pull/5089) -- ContactCard: 新增 show-set-default 属性 [\#5083](https://github.com/youzan/vant/pull/5083) +- ContactCard: 新增 show-set-default、set-default-label 属性 [\#5083](https://github.com/youzan/vant/pull/5083) - Toast: 完善 TS 类型定义 [\#5086](https://github.com/youzan/vant/pull/5086) **Bug Fixes** diff --git a/src/address-list/README.md b/src/address-list/README.md index 7187257af..a95977951 100644 --- a/src/address-list/README.md +++ b/src/address-list/README.md @@ -77,7 +77,7 @@ export default { | disabled-text | Disabled text | *string* | - | - | | switchable | Whether to allow switch address | *boolean* | `true` | - | | add-button-text | Add button text | *string* | `Add new address` | - | -| default-tag-text | Default tag text | *string* | - | - | +| default-tag-text | Default tag text | *string* | - | 2.3.0 | ### Events diff --git a/src/address-list/README.zh-CN.md b/src/address-list/README.zh-CN.md index 1bdc323bb..4784b9e06 100644 --- a/src/address-list/README.zh-CN.md +++ b/src/address-list/README.zh-CN.md @@ -78,7 +78,7 @@ export default { | disabled-text | 不可配送提示文案 | *string* | - | - | | switchable | 是否允许切换地址 | *boolean* | `true` | - | | add-button-text | 底部按钮文字 | *string* | `新增地址` | - | -| default-tag-text | 默认地址标签文字 | *string* | - | - | +| default-tag-text | 默认地址标签文字 | *string* | - | 2.3.0 | ### Events diff --git a/src/contact-card/README.md b/src/contact-card/README.md index e1e2d3e1e..d082319ac 100644 --- a/src/contact-card/README.md +++ b/src/contact-card/README.md @@ -155,7 +155,7 @@ export default { | v-model | Id of chosen contact | *string \| number* | - | - | | list | Contact list | *Contact[]* | `[]` | - | | add-text | Add button text | *string* | `Add new contact` | - | -| default-tag-text | Default tag text | *string* | - | - | +| default-tag-text | Default tag text | *string* | - | 2.3.0 | ### ContactList Events @@ -175,8 +175,8 @@ export default { | is-saving | Whether to show save button loading status | *boolean* | `false` | - | | is-deleting | Whether to show delete button loading status | *boolean* | `false` | - | | tel-validator | The method to validate tel | *(tel: string) => boolean* | - | - | -| show-set-default | Whether to show default contact switch | *boolean* | `false` | - | -| set-default-label | default contact switch label | *string* | - | - | +| show-set-default | Whether to show default contact switch | *boolean* | `false` | 2.3.0 | +| set-default-label | default contact switch label | *string* | - | 2.3.0 | ### ContactEdit Events diff --git a/src/contact-card/README.zh-CN.md b/src/contact-card/README.zh-CN.md index c5883b390..d77059e1e 100644 --- a/src/contact-card/README.zh-CN.md +++ b/src/contact-card/README.zh-CN.md @@ -159,7 +159,7 @@ export default { | v-model | 当前选中联系人的 id | *string \| number* | - | - | | list | 联系人列表 | *Contact[]* | `[]` | - | | add-text | 新建按钮文案 | *string* | `新建联系人` | - | -| default-tag-text | 默认联系人标签文案 | *string* | - | - | +| default-tag-text | 默认联系人标签文案 | *string* | - | 2.3.0 | ### ContactList Events @@ -178,8 +178,8 @@ export default { | is-saving | 是否显示保存按钮加载动画 | *boolean* | `false` | - | | is-deleting | 是否显示删除按钮加载动画 | *boolean* | `false` | - | | tel-validator | 手机号格式校验函数 | *(tel: string) => boolean* | - | - | -| show-set-default | 是否显示默认联系人栏 | *boolean* | `false` | - | -| set-default-label | 默认联系人栏文案 | *string* | - | - | +| show-set-default | 是否显示默认联系人栏 | *boolean* | `false` | 2.3.0 | +| set-default-label | 默认联系人栏文案 | *string* | - | 2.3.0 | ### ContactEdit Events diff --git a/src/coupon-list/README.md b/src/coupon-list/README.md index 7704d3791..1ab147a2e 100644 --- a/src/coupon-list/README.md +++ b/src/coupon-list/README.md @@ -99,7 +99,7 @@ export default { | input-placeholder | Input placeholder | *string* | `Coupon code` | - | | currency | Currency symbol | *string* | `¥` | - | | empty-image | Placeholder image when list is empty | *string* | `https://img.yzcdn.cn/vant/coupon-empty.png` | - | -| show-count | Whether to show coupon count in tab title | *boolean* | `true` | - | +| show-count | Whether to show coupon count in tab title | *boolean* | `true` | 2.3.0 | ### CouponList Events diff --git a/src/coupon-list/README.zh-CN.md b/src/coupon-list/README.zh-CN.md index f8dd8bc9b..647cdd39a 100644 --- a/src/coupon-list/README.zh-CN.md +++ b/src/coupon-list/README.zh-CN.md @@ -101,7 +101,7 @@ export default { | show-exchange-bar | 是否展示兑换栏 | *boolean* | `true` | - | | currency | 货币符号 | *string* | `¥` | - | | empty-image | 列表为空时的占位图 | *string* | `https://img.yzcdn.cn/vant/coupon-empty.png` | 2.1.0 | -| show-count | 是否展示可用 / 不可用数量 | *boolean* | `true` | - | +| show-count | 是否展示可用 / 不可用数量 | *boolean* | `true` | 2.3.0 | ### CouponList Events diff --git a/src/sku/README.md b/src/sku/README.md index 338ae6218..26723c7e0 100644 --- a/src/sku/README.md +++ b/src/sku/README.md @@ -141,7 +141,7 @@ export default { | message-config | Message related config | *object* | `{}` | - | | get-container | Return the mount node for sku | *string \| () => Element* | - | - | | safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `false` | 2.2.1 | -| start-sale-num | Minimum quantity | *number* | `1` | 2.2.15 | +| start-sale-num | Minimum quantity | *number* | `1` | 2.3.0 | ### Events diff --git a/src/sku/README.zh-CN.md b/src/sku/README.zh-CN.md index c1c23b0a8..84f88b9e7 100644 --- a/src/sku/README.zh-CN.md +++ b/src/sku/README.zh-CN.md @@ -145,7 +145,7 @@ export default { | initial-sku | 默认选中的 sku,具体参考高级用法 | *object* | `{}` | - | | show-soldout-sku | 是否展示售罄的 sku,默认展示并置灰 | *boolean* | `true` | - | | safe-area-inset-bottom | 是否开启底部安全区适配,[详细说明](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `false` | 2.2.1 | -| start-sale-num | 起售数量 | *number* | `1` | 2.2.15 | +| start-sale-num | 起售数量 | *number* | `1` | 2.3.0 | ### Events diff --git a/src/submit-bar/README.md b/src/submit-bar/README.md index a4f5b18e2..0a3b1c212 100644 --- a/src/submit-bar/README.md +++ b/src/submit-bar/README.md @@ -75,7 +75,7 @@ Use slot to add custom contents. | price | Price | *number* | - | - | | label | Price left label | *string* | `Total:` | - | | suffix-label | Price right label | *string* | - | - | -| text-align | Price label text align can be set to `right` `left` | *string* | `right` | - | +| text-align | Price label text align can be set to `right` `left` | *string* | `right` | 2.3.0 | | button-text | Button text | *string* | - | - | | button-type | Button type | *string* | `danger` | - | | tip | Tip | *string* | - | - | diff --git a/src/submit-bar/README.zh-CN.md b/src/submit-bar/README.zh-CN.md index 1070deb35..73fc94831 100644 --- a/src/submit-bar/README.zh-CN.md +++ b/src/submit-bar/README.zh-CN.md @@ -75,7 +75,7 @@ Vue.use(SubmitBar); | price | 价格(单位分) | *number* | - | - | | label | 价格左侧文案 | *string* | `合计:` | - | | suffix-label | 价格右侧文案 | *string* | - | - | -| text-align | 价格文案对齐方向,可选值为 `right` `left` | *string* | `right` | - | +| text-align | 价格文案对齐方向,可选值为 `right` `left` | *string* | `right` | 2.3.0 | | button-text | 按钮文字 | *string* | - | - | | button-type | 按钮类型 | *string* | `danger` | - | | tip | 提示文案 | *string* | - | - | From 308c0a9a92de23c28a0fa62711b50c3746792bf9 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 8 Dec 2019 08:15:55 +0800 Subject: [PATCH 8/8] docs(Icon): improve demo (#5215) --- src/icon/README.md | 16 +-- src/icon/README.zh-CN.md | 19 ++- src/icon/demo/index.vue | 119 ++++++++++-------- src/sidebar/README.zh-CN.md | 2 +- src/sidebar/demo/index.vue | 6 +- .../test/__snapshots__/demo.spec.js.snap | 2 +- src/tabbar/README.md | 5 +- src/tabbar/README.zh-CN.md | 7 +- src/tabbar/demo/index.vue | 2 +- 9 files changed, 91 insertions(+), 87 deletions(-) diff --git a/src/icon/README.md b/src/icon/README.md index c25a1e656..f17477afb 100644 --- a/src/icon/README.md +++ b/src/icon/README.md @@ -16,7 +16,7 @@ Vue.use(Icon); Use `name` prop to set icon name or icon URL ```html - + ``` @@ -27,9 +27,9 @@ Use `dot` prop, a small red dot will be displayed in the upper right corner of t Use `info` prop, the info will be displayed in the upper right corner of the icon. ```html - - - + + + ``` ### Icon Color @@ -37,8 +37,8 @@ Use `info` prop, the info will be displayed in the upper right corner of the ico Use `color` prop to set icon color ```html - - + + ``` ### Icon Size @@ -46,8 +46,8 @@ Use `color` prop to set icon color Use `size` prop to set icon size ```html - - + + ``` ### Use local font file diff --git a/src/icon/README.zh-CN.md b/src/icon/README.zh-CN.md index 168f0b41b..b3a103404 100644 --- a/src/icon/README.zh-CN.md +++ b/src/icon/README.zh-CN.md @@ -20,7 +20,7 @@ Vue.use(Icon); `Icon`的`name`属性支持传入图标名称或图片链接,所有可用的图标名称见右侧示例 ```html - + ``` @@ -29,28 +29,27 @@ Vue.use(Icon); 设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标 ```html - - - + + + ``` - ### 图标颜色 `Icon`的`color`属性用来设置图标的颜色 ```html - - + + ``` ### 图标大小 -`Icon`的`size`属性用来设置图标的尺寸大小 +`Icon`的`size`属性用来设置图标的尺寸大小,默认单位为`px` ```html - - + + ``` ### 使用本地字体文件 diff --git a/src/icon/demo/index.vue b/src/icon/demo/index.vue index 6e5086ea8..5afc03bf5 100644 --- a/src/icon/demo/index.vue +++ b/src/icon/demo/index.vue @@ -1,76 +1,89 @@