feat: update steps
parent
e8743ec48d
commit
3d41b55ba3
|
@ -10,6 +10,7 @@ The whole of the step bar.
|
||||||
| progressDot | Steps with progress dot style, customize the progress dot by setting a scoped slot. labelPlacement will be `vertical` | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
|
| progressDot | Steps with progress dot style, customize the progress dot by setting a scoped slot. labelPlacement will be `vertical` | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
|
||||||
| size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default` |
|
| size | to specify the size of the step bar, `default` and `small` are currently supported | string | `default` |
|
||||||
| status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` |
|
| status | to specify the status of current step, can be set to one of the following values: `wait` `process` `finish` `error` | string | `process` |
|
||||||
|
| initial | set the initial step, counting from 0 | number | 0 |
|
||||||
|
|
||||||
### Steps.Step
|
### Steps.Step
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,15 @@
|
||||||
import PropTypes from '../_util/vue-types'
|
import PropTypes from '../_util/vue-types'
|
||||||
import { initDefaultProps, getOptionProps, getComponentFromProp } from '../_util/props-util'
|
import { initDefaultProps, getOptionProps, getComponentFromProp } from '../_util/props-util'
|
||||||
import VcSteps from '../vc-steps'
|
import VcSteps from '../vc-steps'
|
||||||
|
import Icon from '../icon'
|
||||||
|
|
||||||
const getStepsProps = (defaultProps = {}) => {
|
const getStepsProps = (defaultProps = {}) => {
|
||||||
const props = {
|
const props = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
iconPrefix: PropTypes.string,
|
iconPrefix: PropTypes.string,
|
||||||
current: PropTypes.number,
|
current: PropTypes.number,
|
||||||
|
initial: PropTypes.number,
|
||||||
|
labelPlacement: PropTypes.oneOf(['horizontal', 'vertical']),
|
||||||
status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']),
|
status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']),
|
||||||
size: PropTypes.oneOf(['default', 'small']),
|
size: PropTypes.oneOf(['default', 'small']),
|
||||||
direction: PropTypes.oneOf(['horizontal', 'vertical']),
|
direction: PropTypes.oneOf(['horizontal', 'vertical']),
|
||||||
|
@ -29,13 +32,15 @@ const Steps = {
|
||||||
Step: { ...VcSteps.Step, name: 'AStep' },
|
Step: { ...VcSteps.Step, name: 'AStep' },
|
||||||
render () {
|
render () {
|
||||||
const props = getOptionProps(this)
|
const props = getOptionProps(this)
|
||||||
|
const { prefixCls } = props
|
||||||
|
const icons = {
|
||||||
|
finish: <Icon type='check' className={`${prefixCls}-finish-icon`} />,
|
||||||
|
error: <Icon type='close' className={`${prefixCls}-error-icon`} />,
|
||||||
|
}
|
||||||
const stepsProps = {
|
const stepsProps = {
|
||||||
props: {
|
props: {
|
||||||
...props,
|
...props,
|
||||||
icons: props.icons || {
|
icons,
|
||||||
error: getComponentFromProp(this, 'icons.error'),
|
|
||||||
finish: getComponentFromProp(this, 'icons.finish'),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
on: this.$listeners,
|
on: this.$listeners,
|
||||||
scopedSlots: this.$scopedSlots,
|
scopedSlots: this.$scopedSlots,
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
| progressDot | 点状步骤条,可以设置为一个 作用域插槽,labelPlacement 将强制为`vertical` | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
|
| progressDot | 点状步骤条,可以设置为一个 作用域插槽,labelPlacement 将强制为`vertical` | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false |
|
||||||
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default |
|
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default |
|
||||||
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process |
|
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process |
|
||||||
|
| initial | 起始序号,从 0 开始记数 | number | 0 |
|
||||||
|
|
||||||
### Steps.Step
|
### Steps.Step
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue