@@ -17,7 +17,6 @@ import { booleanType, stringType, functionType, someType } from '../_util/type';
17
17
18
18
// CSSINJS
19
19
import useStyle from './style' ;
20
- import { useToken } from '../theme/internal' ;
21
20
22
21
export const stepsProps = ( ) => ( {
23
22
prefixCls : String ,
@@ -30,11 +29,8 @@ export const stepsProps = () => ({
30
29
status : stringType < 'wait' | 'process' | 'finish' | 'error' > ( ) ,
31
30
size : stringType < 'default' | 'small' > ( ) ,
32
31
direction : stringType < 'horizontal' | 'vertical' > ( ) ,
33
- progressDot : someType < boolean | ProgressDotRender > (
34
- [ Boolean , Function ] ,
35
- undefined as boolean | ProgressDotRender ,
36
- ) ,
37
- type : stringType < 'default' | 'navigation' > ( ) ,
32
+ progressDot : someType < boolean | ProgressDotRender > ( [ Boolean , Function ] ) ,
33
+ type : stringType < 'default' | 'navigation' | 'inline' > ( ) ,
38
34
onChange : functionType < ( current : number ) => void > ( ) ,
39
35
'onUpdate:current' : functionType < ( current : number ) => void > ( ) ,
40
36
} ) ;
@@ -67,9 +63,6 @@ const Steps = defineComponent({
67
63
setup ( props , { attrs, slots, emit } ) {
68
64
const { prefixCls, direction : rtlDirection , configProvider } = useConfigInject ( 'steps' , props ) ;
69
65
70
- // 接入换肤
71
- const [ , token ] = useToken ( ) ;
72
-
73
66
// style
74
67
const [ wrapSSR , hashId ] = useStyle ( prefixCls ) ;
75
68
@@ -82,6 +75,8 @@ const Steps = defineComponent({
82
75
emit ( 'update:current' , current ) ;
83
76
emit ( 'change' , current ) ;
84
77
} ;
78
+ const isInline = computed ( ( ) => props . type === 'inline' ) ;
79
+ const mergedPercent = computed ( ( ) => ( isInline . value ? undefined : props . percent ) ) ;
85
80
const stepIconRender = ( {
86
81
node,
87
82
status,
@@ -99,9 +94,8 @@ const Steps = defineComponent({
99
94
< div class = { `${ prefixCls . value } -progress-icon` } >
100
95
< Progress
101
96
type = "circle"
102
- percent = { props . percent }
97
+ percent = { mergedPercent . value }
103
98
width = { progressWidth }
104
- strokeColor = { token . value . colorPrimary }
105
99
strokeWidth = { 4 }
106
100
format = { ( ) => null }
107
101
/>
@@ -112,22 +106,23 @@ const Steps = defineComponent({
112
106
}
113
107
return node ;
114
108
} ;
109
+ const icons = computed ( ( ) => ( {
110
+ finish : < CheckOutlined class = { `${ prefixCls . value } -finish-icon` } /> ,
111
+ error : < CloseOutlined class = { `${ prefixCls . value } -error-icon` } /> ,
112
+ } ) ) ;
115
113
return ( ) => {
116
114
const stepsClassName = classNames (
117
115
{
118
116
[ `${ prefixCls . value } -rtl` ] : rtlDirection . value === 'rtl' ,
119
- [ `${ prefixCls . value } -with-progress` ] : props . percent !== undefined ,
117
+ [ `${ prefixCls . value } -with-progress` ] : mergedPercent . value !== undefined ,
120
118
} ,
121
119
attrs . class ,
122
120
hashId . value ,
123
121
) ;
124
- const icons = {
125
- finish : < CheckOutlined class = { `${ prefixCls } -finish-icon` } /> ,
126
- error : < CloseOutlined class = { `${ prefixCls } -error-icon` } /> ,
127
- } ;
122
+
128
123
return wrapSSR (
129
124
< VcSteps
130
- icons = { icons }
125
+ icons = { icons . value }
131
126
{ ...attrs }
132
127
{ ...omit ( props , [ 'percent' , 'responsive' ] ) }
133
128
direction = { direction . value }
0 commit comments