Step add slot icon

This commit is contained in:
梁灏 2019-09-17 16:31:47 +08:00
parent c704113d0d
commit b36ba86406
2 changed files with 6 additions and 3 deletions

View file

@ -3,7 +3,8 @@
<div :class="[prefixCls + '-tail']"><i></i></div>
<div :class="[prefixCls + '-head']">
<div :class="[prefixCls + '-head-inner']">
<span v-if="!icon && currentStatus !== 'finish' && currentStatus !== 'error'">{{ stepNumber }}</span>
<span v-if="!icon && !$slots.icon && currentStatus !== 'finish' && currentStatus !== 'error'">{{ stepNumber }}</span>
<span v-else-if="$slots.icon" class="ivu-steps-icon"><slot name="icon"></slot></span>
<span v-else :class="iconClasses"></span>
</div>
</div>
@ -57,7 +58,7 @@
`${prefixCls}-item`,
`${prefixCls}-status-${this.currentStatus}`,
{
[`${prefixCls}-custom`]: !!this.icon,
[`${prefixCls}-custom`]: !!this.icon || !!this.$slots.icon,
[`${prefixCls}-next-error`]: this.nextError
}
];