2018-03-09 10:52:31 +00:00
|
|
|
<script>
|
|
|
|
import PropTypes from '../_util/vue-types'
|
2018-03-11 04:48:04 +00:00
|
|
|
import { initDefaultProps, getOptionProps } from '../_util/props-util'
|
2018-03-09 10:52:31 +00:00
|
|
|
import VcSteps from '../vc-steps'
|
|
|
|
|
|
|
|
const getStepsProps = (defaultProps = {}) => {
|
|
|
|
const props = {
|
|
|
|
prefixCls: PropTypes.string,
|
|
|
|
iconPrefix: PropTypes.string,
|
|
|
|
current: PropTypes.number,
|
|
|
|
status: PropTypes.oneOf(['wait', 'process', 'finish', 'error']),
|
|
|
|
size: PropTypes.oneOf(['default', 'small']),
|
|
|
|
direction: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
|
|
progressDot: PropTypes.oneOfType([
|
|
|
|
PropTypes.bool,
|
|
|
|
PropTypes.func,
|
|
|
|
]),
|
|
|
|
}
|
|
|
|
return initDefaultProps(props, defaultProps)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Steps',
|
|
|
|
props: getStepsProps({
|
|
|
|
prefixCls: 'ant-steps',
|
|
|
|
iconPrefix: 'ant',
|
|
|
|
current: 0,
|
|
|
|
}),
|
|
|
|
Step: VcSteps.Step,
|
|
|
|
render () {
|
|
|
|
const props = getOptionProps(this)
|
|
|
|
const stepsProps = {
|
|
|
|
props,
|
|
|
|
on: this.$listeners,
|
2018-03-13 02:19:00 +00:00
|
|
|
scopedSlots: this.$scopedSlots,
|
2018-03-09 10:52:31 +00:00
|
|
|
}
|
|
|
|
return (
|
|
|
|
<VcSteps
|
|
|
|
{...stepsProps}
|
|
|
|
>
|
2018-03-11 04:48:04 +00:00
|
|
|
{this.$slots.default}
|
2018-03-09 10:52:31 +00:00
|
|
|
</VcSteps>
|
|
|
|
)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|