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: {
|
methods: {
|
||||||
genCircle() {
|
genCircle() {
|
||||||
const { activeIcon, activeColor, finishIcon, inactiveIcon } = this.parent;
|
const {
|
||||||
|
activeIcon,
|
||||||
|
iconPrefix,
|
||||||
|
activeColor,
|
||||||
|
finishIcon,
|
||||||
|
inactiveIcon,
|
||||||
|
} = this.parent;
|
||||||
|
|
||||||
if (this.active) {
|
if (this.active) {
|
||||||
return (
|
return (
|
||||||
@ -50,6 +56,7 @@ export default createComponent({
|
|||||||
class={bem('icon', 'active')}
|
class={bem('icon', 'active')}
|
||||||
name={activeIcon}
|
name={activeIcon}
|
||||||
color={activeColor}
|
color={activeColor}
|
||||||
|
classPrefix={iconPrefix}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -63,6 +70,7 @@ export default createComponent({
|
|||||||
class={bem('icon', 'finish')}
|
class={bem('icon', 'finish')}
|
||||||
name={finishIcon}
|
name={finishIcon}
|
||||||
color={activeColor}
|
color={activeColor}
|
||||||
|
classPrefix={iconPrefix}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -72,7 +80,13 @@ export default createComponent({
|
|||||||
|
|
||||||
if (inactiveIcon || inactiveIconSlot) {
|
if (inactiveIcon || inactiveIconSlot) {
|
||||||
return (
|
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` |
|
| active-icon | Active icon name | _string_ | `checked` |
|
||||||
| inactive-icon | Inactive icon name | _string_ | - |
|
| inactive-icon | Inactive icon name | _string_ | - |
|
||||||
| finish-icon `v2.12.7` | Finish 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
|
### Step Slots
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ export default {
|
|||||||
| active-icon | 激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | `checked` |
|
| active-icon | 激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | `checked` |
|
||||||
| inactive-icon | 未激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | - |
|
| inactive-icon | 未激活状态底部图标,可选值见 [Icon 组件](#/zh-CN/icon) | _string_ | - |
|
||||||
| finish-icon `v2.12.7` | 已完成步骤对应的底部图标,优先级高于 `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
|
### Step Slots
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ export default createComponent({
|
|||||||
mixins: [ParentMixin('vanSteps')],
|
mixins: [ParentMixin('vanSteps')],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
iconPrefix: String,
|
||||||
finishIcon: String,
|
finishIcon: String,
|
||||||
activeColor: String,
|
activeColor: String,
|
||||||
inactiveIcon: String,
|
inactiveIcon: String,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user