1
- import type { ExtractPropTypes , CSSProperties , PropType } from 'vue' ;
1
+ import type { ExtractPropTypes , CSSProperties } from 'vue' ;
2
2
import { defineComponent , ref , onMounted , onBeforeUnmount , computed } from 'vue' ;
3
3
import classNames from '../_util/classNames' ;
4
4
import type { Breakpoint , ScreenMap } from '../_util/responsiveObserve' ;
@@ -7,6 +7,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
7
7
import useFlexGapSupport from '../_util/hooks/useFlexGapSupport' ;
8
8
import useProvideRow from './context' ;
9
9
import { useRowStyle } from './style' ;
10
+ import { someType } from '../_util/type' ;
10
11
11
12
const RowAligns = [ 'top' , 'middle' , 'bottom' , 'stretch' ] as const ;
12
13
const RowJustify = [
@@ -34,13 +35,10 @@ export interface rowContextState {
34
35
}
35
36
36
37
export const rowProps = ( ) => ( {
37
- align : [ String , Object ] as PropType < ( typeof RowAligns ) [ number ] | ResponsiveAligns > ,
38
- justify : [ String , Object ] as PropType < ( typeof RowJustify ) [ number ] | ResponsiveJustify > ,
38
+ align : someType < ( typeof RowAligns ) [ number ] | ResponsiveAligns > ( [ String , Object ] ) ,
39
+ justify : someType < ( typeof RowJustify ) [ number ] | ResponsiveJustify > ( [ String , Object ] ) ,
39
40
prefixCls : String ,
40
- gutter : {
41
- type : [ Number , Array , Object ] as PropType < Gutter | [ Gutter , Gutter ] > ,
42
- default : 0 as Gutter | [ Gutter , Gutter ] ,
43
- } ,
41
+ gutter : someType < Gutter | [ Gutter , Gutter ] > ( [ Number , Array , Object ] , 0 ) ,
44
42
wrap : { type : Boolean , default : undefined } ,
45
43
} ) ;
46
44
@@ -49,8 +47,8 @@ export type RowProps = Partial<ExtractPropTypes<ReturnType<typeof rowProps>>>;
49
47
const ARow = defineComponent ( {
50
48
compatConfig : { MODE : 3 } ,
51
49
name : 'ARow' ,
52
- props : rowProps ( ) ,
53
50
inheritAttrs : false ,
51
+ props : rowProps ( ) ,
54
52
setup ( props , { slots, attrs } ) {
55
53
const { prefixCls, direction } = useConfigInject ( 'row' , props ) ;
56
54
const [ wrapSSR , hashId ] = useRowStyle ( prefixCls ) ;
0 commit comments