Skip to content

Commit d4a3e88

Browse files
authored
fix(image-viewer): fix i18n text (#3636)
1 parent 1cfdaff commit d4a3e88

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/image-viewer/base/ImageViewerUtils.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ export default defineComponent({
2727
mirrorHandler: Function as PropType<() => void>,
2828
resetHandler: Function as PropType<() => void>,
2929
downloadHandler: Function as PropType<(url: string) => void>,
30+
globalConfig: Object,
3031
currentImage,
3132
},
3233
setup(props) {
33-
const { classPrefix, global: globalConfig } = useConfig('imageViewer');
34-
34+
const { classPrefix } = useConfig('imageViewer');
3535
const imageUrl = computed(() => props.currentImage.mainImage);
3636

3737
const { previewUrl } = useImagePreviewUrl(imageUrl);
3838

3939
return {
4040
classPrefix,
41-
globalConfig,
41+
4242
previewUrl,
4343
};
4444
},

src/image-viewer/image-viewer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import TImageItem from './base/ImageItem';
1010
import TImageViewerModal from './base/ImageViewerModal';
1111
import useVModel from '../hooks/useVModel';
1212
import useDefaultValue from '../hooks/useDefaultValue';
13-
import { usePrefixClass } from '../hooks/useConfig';
13+
import { usePrefixClass, useConfig } from '../hooks/useConfig';
1414
import { renderTNodeJSX } from '../utils/render-tnode';
1515
import { setTransform } from '../utils/helper';
1616
import { TdImageViewerProps } from './type';
1717
import { useMirror, useRotate, useScale } from './hooks';
18+
1819
import { downloadFile, formatImages, getOverlay } from './utils';
1920
import { EVENT_CODE, DEFAULT_IMAGE_SCALE } from './const';
2021
import 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

Comments
 (0)