File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Expand file tree Collapse file tree 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' ;
23import { computed , defineComponent } from 'vue' ;
34import useConfigInject from '../_util/hooks/useConfigInject' ;
45
@@ -20,11 +21,13 @@ export const icons = {
2021 right : < RightOutlined /> ,
2122} ;
2223
24+ export type ImageGroupProps = Partial < ExtractPropTypes < ReturnType < typeof imageGroupProps > > > ;
25+
2326const InternalPreviewGroup = defineComponent ( {
2427 compatConfig : { MODE : 3 } ,
2528 name : 'AImagePreviewGroup' ,
2629 inheritAttrs : false ,
27- props : { previewPrefixCls : String } ,
30+ props : imageGroupProps ( ) ,
2831 setup ( props , { attrs, slots } ) {
2932 const { getPrefixCls } = useConfigInject ( 'image' , props ) ;
3033 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 = {
5656 } ,
5757} ;
5858
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+
5971const Group = defineComponent ( {
6072 compatConfig : { MODE : 3 } ,
6173 name : 'PreviewGroup' ,
6274 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 ( ) ,
7476 setup ( props , { slots } ) {
7577 const preview = computed < PreviewGroupPreview > ( ( ) => {
7678 const defaultValues = {
You can’t perform that action at this time.
0 commit comments