mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 23:19:15 +08:00
feat(Steps): add icon-prefix prop (#8630)
This commit is contained in:
parent
1779946edb
commit
f470f0f854
@ -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 || <Icon class={bem('icon')} name={inactiveIcon} />
|
||||
inactiveIconSlot || (
|
||||
<Icon
|
||||
class={bem('icon')}
|
||||
name={inactiveIcon}
|
||||
classPrefix={iconPrefix}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -7,6 +7,7 @@ export default createComponent({
|
||||
mixins: [ParentMixin('vanSteps')],
|
||||
|
||||
props: {
|
||||
iconPrefix: String,
|
||||
finishIcon: String,
|
||||
activeColor: String,
|
||||
inactiveIcon: String,
|
||||
|
Loading…
x
Reference in New Issue
Block a user