mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Steps): add finish-icon prop (#8237)
This commit is contained in:
parent
8078e30cbc
commit
42d8dd4256
@ -41,7 +41,7 @@ export default createComponent({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
genCircle() {
|
genCircle() {
|
||||||
const { activeIcon, activeColor, inactiveIcon } = this.parent;
|
const { activeIcon, activeColor, finishIcon, inactiveIcon } = this.parent;
|
||||||
|
|
||||||
if (this.active) {
|
if (this.active) {
|
||||||
return (
|
return (
|
||||||
@ -55,6 +55,16 @@ export default createComponent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.status === 'finish' && finishIcon) {
|
||||||
|
return (
|
||||||
|
<Icon
|
||||||
|
class={bem('icon', 'finish')}
|
||||||
|
name={finishIcon}
|
||||||
|
color={activeColor}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const inactiveIconSlot = this.slots('inactive-icon');
|
const inactiveIconSlot = this.slots('inactive-icon');
|
||||||
|
|
||||||
if (inactiveIcon || inactiveIconSlot) {
|
if (inactiveIcon || inactiveIconSlot) {
|
||||||
|
@ -144,7 +144,8 @@
|
|||||||
&__title {
|
&__title {
|
||||||
transition: color @animation-duration-base;
|
transition: color @animation-duration-base;
|
||||||
|
|
||||||
&--active {
|
&--active,
|
||||||
|
&--finish {
|
||||||
color: @step-active-color;
|
color: @step-active-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,7 @@ export default {
|
|||||||
| inactive-color `v2.9.1` | Inactive step color | _string_ | `#969799` |
|
| inactive-color `v2.9.1` | Inactive step color | _string_ | `#969799` |
|
||||||
| 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_ | - |
|
||||||
|
|
||||||
### Step Slots
|
### Step Slots
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ export default {
|
|||||||
| inactive-color `v2.9.1` | 未激活状态颜色 | _string_ | `#969799` |
|
| inactive-color `v2.9.1` | 未激活状态颜色 | _string_ | `#969799` |
|
||||||
| 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_ | - |
|
||||||
|
|
||||||
### Step Slots
|
### Step Slots
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ export default createComponent({
|
|||||||
mixins: [ParentMixin('vanSteps')],
|
mixins: [ParentMixin('vanSteps')],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
finishIcon: String,
|
||||||
activeColor: String,
|
activeColor: String,
|
||||||
inactiveIcon: String,
|
inactiveIcon: String,
|
||||||
inactiveColor: String,
|
inactiveColor: String,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user