Skip to content

Commit

Permalink
fix(image-viewer): 去除默认值设置以使用globalConfig中的默认值,避免在不同语言环境中出现异常
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbadmaster committed Dec 7, 2023
1 parent cdc9f25 commit 9ebe5da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/image-viewer/base/ImageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineComponent({
const loaded = ref(false);
const { transform, mouseDownHandler } = useDrag({ translateX: 0, translateY: 0 });
const { globalConfig } = useConfig('imageViewer');
const errorText = globalConfig.value.errorText ?? '图片加载失败,可尝试重新加载';
const errorText = globalConfig.value.errorText;

const imgStyle = computed(() => ({
transform: `rotate(${props.rotate}deg) scale(${props.scale})`,
Expand Down
6 changes: 3 additions & 3 deletions src/image-viewer/base/ImageViewerUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default defineComponent({
<div class={`${classPrefix.value}-image-viewer__utils-content`}>
<TToolTip
overlayClassName={`${classPrefix.value}-image-viewer__utils--tip`}
content={globalConfig.value.mirrorTipText ?? '镜像'}
content={globalConfig.value.mirrorTipText}
destroyOnClose
placement="top"
showArrow
Expand All @@ -46,7 +46,7 @@ export default defineComponent({
</TToolTip>
<TToolTip
overlayClassName={`${classPrefix.value}-image-viewer__utils--tip`}
content={globalConfig.value.rotateTipText ?? '旋转'}
content={globalConfig.value.rotateTipText}
destroyOnClose
placement="top"
showArrow
Expand All @@ -64,7 +64,7 @@ export default defineComponent({
<TImageViewerIcon icon={() => <ZoomInIcon size="medium" />} onClick={props.onZoomIn} />
<TToolTip
overlayClassName={`${classPrefix.value}-image-viewer__utils--tip`}
content={globalConfig.value.originalSizeTipText ?? '原始大小'}
content={globalConfig.value.originalSizeTipText}
destroyOnClose
placement="top"
showArrow
Expand Down

0 comments on commit 9ebe5da

Please sign in to comment.