@@ -10,11 +10,12 @@ import TImageItem from './base/ImageItem';
1010import TImageViewerModal from './base/ImageViewerModal' ;
1111import useVModel from '../hooks/useVModel' ;
1212import useDefaultValue from '../hooks/useDefaultValue' ;
13- import { usePrefixClass } from '../hooks/useConfig' ;
13+ import { usePrefixClass , useConfig } from '../hooks/useConfig' ;
1414import { renderTNodeJSX } from '../utils/render-tnode' ;
1515import { setTransform } from '../utils/helper' ;
1616import { TdImageViewerProps } from './type' ;
1717import { useMirror , useRotate , useScale } from './hooks' ;
18+
1819import { downloadFile , formatImages , getOverlay } from './utils' ;
1920import { EVENT_CODE , DEFAULT_IMAGE_SCALE } from './const' ;
2021import Image from '../image' ;
@@ -29,6 +30,8 @@ export default defineComponent({
2930 setup ( props , { emit, listeners } ) {
3031 const classPrefix = usePrefixClass ( ) ;
3132 const COMPONENT_NAME = usePrefixClass ( 'image-viewer' ) ;
33+ const { globalConfig } = useConfig ( 'imageViewer' ) ;
34+
3235 const isExpand = ref ( true ) ;
3336 const showOverlayValue = computed ( ( ) => getOverlay ( props ) ) ;
3437
@@ -222,6 +225,7 @@ export default defineComponent({
222225 containerRef,
223226 keydownHandler,
224227 divRef,
228+ globalConfig,
225229 } ;
226230 } ,
227231 methods : {
@@ -345,6 +349,7 @@ export default defineComponent({
345349 rotateHandler = { this . onRotate }
346350 scale = { this . scale }
347351 currentImage = { this . currentImage }
352+ globalConfig = { this . globalConfig }
348353 />
349354 < TImageItem
350355 scale = { this . scale }
0 commit comments