File tree 2 files changed +18
-13
lines changed
2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 1
- import PreviewGroup from '../vc-image/src/PreviewGroup' ;
1
+ import PreviewGroup , { imageGroupProps } from '../vc-image/src/PreviewGroup' ;
2
+ import type { ExtractPropTypes } from 'vue' ;
2
3
import { computed , defineComponent } from 'vue' ;
3
4
import useConfigInject from '../_util/hooks/useConfigInject' ;
4
5
@@ -20,11 +21,13 @@ export const icons = {
20
21
right : < RightOutlined /> ,
21
22
} ;
22
23
24
+ export type ImageGroupProps = Partial < ExtractPropTypes < ReturnType < typeof imageGroupProps > > > ;
25
+
23
26
const InternalPreviewGroup = defineComponent ( {
24
27
compatConfig : { MODE : 3 } ,
25
28
name : 'AImagePreviewGroup' ,
26
29
inheritAttrs : false ,
27
- props : { previewPrefixCls : String } ,
30
+ props : imageGroupProps ( ) ,
28
31
setup ( props , { attrs, slots } ) {
29
32
const { getPrefixCls } = useConfigInject ( 'image' , props ) ;
30
33
const prefixCls = computed ( ( ) => getPrefixCls ( 'image-preview' , props . previewPrefixCls ) ) ;
Original file line number Diff line number Diff line change @@ -56,21 +56,23 @@ export const context = {
56
56
} ,
57
57
} ;
58
58
59
+ export const imageGroupProps = ( ) => ( {
60
+ previewPrefixCls : String ,
61
+ preview : {
62
+ type : [ Boolean , Object ] as PropType < boolean | ImagePreviewType > ,
63
+ default : true as boolean | ImagePreviewType ,
64
+ } ,
65
+ icons : {
66
+ type : Object as PropType < PreviewProps [ 'icons' ] > ,
67
+ default : ( ) => ( { } ) ,
68
+ } ,
69
+ } ) ;
70
+
59
71
const Group = defineComponent ( {
60
72
compatConfig : { MODE : 3 } ,
61
73
name : 'PreviewGroup' ,
62
74
inheritAttrs : false ,
63
- props : {
64
- previewPrefixCls : String ,
65
- preview : {
66
- type : [ Boolean , Object ] as PropType < boolean | ImagePreviewType > ,
67
- default : true as boolean | ImagePreviewType ,
68
- } ,
69
- icons : {
70
- type : Object as PropType < PreviewProps [ 'icons' ] > ,
71
- default : ( ) => ( { } ) ,
72
- } ,
73
- } ,
75
+ props : imageGroupProps ( ) ,
74
76
setup ( props , { slots } ) {
75
77
const preview = computed < PreviewGroupPreview > ( ( ) => {
76
78
const defaultValues = {
You can’t perform that action at this time.
0 commit comments