Commit f0939af 1 parent f52c5c2 commit f0939af Copy full SHA for f0939af
File tree 2 files changed +17
-8
lines changed
2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -117,13 +117,14 @@ class StepItem extends Component {
117
117
width : '' ,
118
118
[ pos ] : '' ,
119
119
} ) ;
120
- } else if (
121
- shape === 'circle' &&
122
- ( labelPlacement === 'horizontal' || labelPlacement === 'hoz' ) &&
123
- index !== total - 1
124
- ) {
125
- // 调整横向Content
126
- this . adjustTail ( ) ;
120
+ if (
121
+ shape === 'circle' &&
122
+ ( labelPlacement === 'horizontal' || labelPlacement === 'hoz' ) &&
123
+ index !== total - 1
124
+ ) {
125
+ // 调整横向Content
126
+ this . adjustTail ( ) ;
127
+ }
127
128
} else if ( index !== total - 1 ) {
128
129
dom . setStyle ( this . tail , {
129
130
width : '' ,
Original file line number Diff line number Diff line change @@ -273,7 +273,15 @@ describe('Step', () => {
273
273
) ;
274
274
275
275
assert ( wrapper . find ( '.next-step-label-vertical' ) . length === 1 ) ;
276
- wrapper . setProps ( { labelPlacement : 'horizontal' } ) ;
276
+ wrapper . setProps ( { labelPlacement : 'horizontal' } , ( ) => {
277
+ // 横向模式下会调整 next-step-item-tail 的宽度值
278
+ const $tail = wrapper . find ( '.next-step-item-tail' ) ;
279
+ assert (
280
+ $tail . length === 3 &&
281
+ $tail . at ( 0 ) . instance ( ) . style . width !== "" &&
282
+ $tail . at ( 2 ) . instance ( ) . style . width === ""
283
+ ) ;
284
+ } ) ;
277
285
assert ( wrapper . find ( '.next-step-label-horizontal' ) . length === 1 ) ;
278
286
} ) ;
279
287
You can’t perform that action at this time.
0 commit comments