From f470f0f854625a1b0d20552c88657947d995bbbe Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 28 Apr 2021 16:58:07 +0800 Subject: [PATCH] feat(Steps): add icon-prefix prop (#8630) --- src/step/index.js | 18 ++++++++++++++++-- src/steps/README.md | 1 + src/steps/README.zh-CN.md | 1 + src/steps/index.js | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/step/index.js b/src/step/index.js index ebb88b14f..36c65864b 100644 --- a/src/step/index.js +++ b/src/step/index.js @@ -41,7 +41,13 @@ export default createComponent({ methods: { genCircle() { - const { activeIcon, activeColor, finishIcon, inactiveIcon } = this.parent; + const { + activeIcon, + iconPrefix, + activeColor, + finishIcon, + inactiveIcon, + } = this.parent; if (this.active) { return ( @@ -50,6 +56,7 @@ export default createComponent({ class={bem('icon', 'active')} name={activeIcon} color={activeColor} + classPrefix={iconPrefix} /> ) ); @@ -63,6 +70,7 @@ export default createComponent({ class={bem('icon', 'finish')} name={finishIcon} color={activeColor} + classPrefix={iconPrefix} /> ) ); @@ -72,7 +80,13 @@ export default createComponent({ if (inactiveIcon || inactiveIconSlot) { return ( - inactiveIconSlot || + inactiveIconSlot || ( + + ) ); } diff --git a/src/steps/README.md b/src/steps/README.md index d1e614d11..afd08f1ce 100644 --- a/src/steps/README.md +++ b/src/steps/README.md @@ -76,6 +76,7 @@ export default { | active-icon | Active icon name | _string_ | `checked` | | inactive-icon | Inactive icon name | _string_ | - | | finish-icon `v2.12.7` | Finish icon name | _string_ | - | +| icon-prefix `v2.12.15` | Icon className prefix | _string_ | `van-icon` | ### Step Slots diff --git a/src/steps/README.zh-CN.md b/src/steps/README.zh-CN.md index 50b620771..17de50564 100644 --- a/src/steps/README.zh-CN.md +++ b/src/steps/README.zh-CN.md @@ -86,6 +86,7 @@ export default { | active-icon | 激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | `checked` | | inactive-icon | 未激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | - | | finish-icon `v2.12.7` | 已完成步骤对应的底部图标,优先级高于 `inactive-icon`,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | - | +| icon-prefix `v2.12.15` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` | ### Step Slots diff --git a/src/steps/index.js b/src/steps/index.js index 95868b054..1b5b5ed11 100644 --- a/src/steps/index.js +++ b/src/steps/index.js @@ -7,6 +7,7 @@ export default createComponent({ mixins: [ParentMixin('vanSteps')], props: { + iconPrefix: String, finishIcon: String, activeColor: String, inactiveIcon: String,