From 02fc2f5e3fb2c33729e46219561f54557d00d96e Mon Sep 17 00:00:00 2001 From: annsion Date: Tue, 5 Jan 2021 18:23:33 +0800 Subject: [PATCH] fix(image): fix iamge prop error --- components/vc-image/src/Image.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/vc-image/src/Image.tsx b/components/vc-image/src/Image.tsx index dd4ce43342..4367e1315b 100644 --- a/components/vc-image/src/Image.tsx +++ b/components/vc-image/src/Image.tsx @@ -44,9 +44,14 @@ export const ImageProps = { previewPrefixCls: PropTypes.string, placeholder: PropTypes.VNodeChild, fallback: PropTypes.string, - preview: PropTypes.oneOfType([PropTypes.looseBool, PropTypes.shape({})]).def( - true, - ), + preview: PropTypes.oneOfType([ + PropTypes.looseBool, + PropTypes.shape({ + visible: PropTypes.bool, + onVisibleChange: PropTypes.func, + getContainer: PropTypes.oneOf([PropTypes.func, PropTypes.bool]), + }), + ]).def(true), }; type ImageStatus = 'normal' | 'error' | 'loading';