Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/image-viewer/base/ImageViewerUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ export default defineComponent({
mirrorHandler: Function as PropType<() => void>,
resetHandler: Function as PropType<() => void>,
downloadHandler: Function as PropType<(url: string) => void>,
globalConfig: Object,
currentImage,
},
setup(props) {
const { classPrefix, global: globalConfig } = useConfig('imageViewer');

const { classPrefix } = useConfig('imageViewer');
const imageUrl = computed(() => props.currentImage.mainImage);

const { previewUrl } = useImagePreviewUrl(imageUrl);

return {
classPrefix,
globalConfig,

previewUrl,
};
},
Expand Down
7 changes: 6 additions & 1 deletion src/image-viewer/image-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import TImageItem from './base/ImageItem';
import TImageViewerModal from './base/ImageViewerModal';
import useVModel from '../hooks/useVModel';
import useDefaultValue from '../hooks/useDefaultValue';
import { usePrefixClass } from '../hooks/useConfig';
import { usePrefixClass, useConfig } from '../hooks/useConfig';
import { renderTNodeJSX } from '../utils/render-tnode';
import { setTransform } from '../utils/helper';
import { TdImageViewerProps } from './type';
import { useMirror, useRotate, useScale } from './hooks';

import { downloadFile, formatImages, getOverlay } from './utils';
import { EVENT_CODE, DEFAULT_IMAGE_SCALE } from './const';
import Image from '../image';
Expand All @@ -29,6 +30,8 @@ export default defineComponent({
setup(props, { emit, listeners }) {
const classPrefix = usePrefixClass();
const COMPONENT_NAME = usePrefixClass('image-viewer');
const { globalConfig } = useConfig('imageViewer');

const isExpand = ref(true);
const showOverlayValue = computed(() => getOverlay(props));

Expand Down Expand Up @@ -222,6 +225,7 @@ export default defineComponent({
containerRef,
keydownHandler,
divRef,
globalConfig,
};
},
methods: {
Expand Down Expand Up @@ -345,6 +349,7 @@ export default defineComponent({
rotateHandler={this.onRotate}
scale={this.scale}
currentImage={this.currentImage}
globalConfig={this.globalConfig}
/>
<TImageItem
scale={this.scale}
Expand Down