From 3d41b55ba35a22513831e555e9249c4eadb58d41 Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Fri, 30 Nov 2018 10:50:26 +0800 Subject: [PATCH] feat: update steps --- components/steps/index.en-US.md | 1 + components/steps/index.jsx | 13 +++++++++---- components/steps/index.zh-CN.md | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/steps/index.en-US.md b/components/steps/index.en-US.md index b0dd6e2ee..437547847 100644 --- a/components/steps/index.en-US.md +++ b/components/steps/index.en-US.md @@ -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 | | 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` | +| initial | set the initial step, counting from 0 | number | 0 | ### Steps.Step diff --git a/components/steps/index.jsx b/components/steps/index.jsx index ca75aecc7..7c2c67db1 100644 --- a/components/steps/index.jsx +++ b/components/steps/index.jsx @@ -2,12 +2,15 @@ import PropTypes from '../_util/vue-types' import { initDefaultProps, getOptionProps, getComponentFromProp } from '../_util/props-util' import VcSteps from '../vc-steps' +import Icon from '../icon' const getStepsProps = (defaultProps = {}) => { const props = { prefixCls: PropTypes.string, iconPrefix: PropTypes.string, current: PropTypes.number, + initial: PropTypes.number, + labelPlacement: PropTypes.oneOf(['horizontal', 'vertical']), status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']), size: PropTypes.oneOf(['default', 'small']), direction: PropTypes.oneOf(['horizontal', 'vertical']), @@ -29,13 +32,15 @@ const Steps = { Step: { ...VcSteps.Step, name: 'AStep' }, render () { const props = getOptionProps(this) + const { prefixCls } = props + const icons = { + finish: , + error: , + } const stepsProps = { props: { ...props, - icons: props.icons || { - error: getComponentFromProp(this, 'icons.error'), - finish: getComponentFromProp(this, 'icons.finish'), - }, + icons, }, on: this.$listeners, scopedSlots: this.$scopedSlots, diff --git a/components/steps/index.zh-CN.md b/components/steps/index.zh-CN.md index d189fa32a..543ec6017 100644 --- a/components/steps/index.zh-CN.md +++ b/components/steps/index.zh-CN.md @@ -11,6 +11,7 @@ | progressDot | 点状步骤条,可以设置为一个 作用域插槽,labelPlacement 将强制为`vertical` | Boolean or slot="progressDot" slot-scope="{index, status, title, description, prefixCls})" | false | | size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | default | | status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | process | +| initial | 起始序号,从 0 开始记数 | number | 0 | ### Steps.Step