mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[breaking change] Steps: remove some prop
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
import { use } from '../utils';
|
||||
import { GREEN } from '../utils/color';
|
||||
import Icon from '../icon';
|
||||
|
||||
const [sfc, bem] = use('steps');
|
||||
|
||||
export default sfc({
|
||||
props: {
|
||||
icon: String,
|
||||
title: String,
|
||||
active: Number,
|
||||
iconClass: String,
|
||||
description: String,
|
||||
direction: {
|
||||
type: String,
|
||||
default: 'horizontal'
|
||||
@@ -32,29 +27,9 @@ export default sfc({
|
||||
},
|
||||
|
||||
render(h) {
|
||||
const { icon, title, description, slots } = this;
|
||||
|
||||
const StatusIcon = (slots('icon') || icon) && (
|
||||
<div class={bem('icon')}>{slots('icon') || <Icon name={icon} class={this.iconClass} />}</div>
|
||||
);
|
||||
|
||||
const StatusMessage = (
|
||||
<div class={bem('message')}>
|
||||
<div class={bem('title')}>{title}</div>
|
||||
<div class={[bem('desc'), 'van-ellipsis']}>{description}</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div class={bem([this.direction])}>
|
||||
{(title || description) && (
|
||||
<div class={bem('status')}>
|
||||
{StatusIcon}
|
||||
{StatusMessage}
|
||||
{slots('message-extra')}
|
||||
</div>
|
||||
)}
|
||||
<div class={bem('items', { alone: !title && !description })}>{slots()}</div>
|
||||
<div class={bem('items')}>{this.slots()}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user