fix: Translation after image loading error.

pull/22959/head
wangdaodao 2024-09-06 15:06:04 +08:00
parent 00ed0b56a6
commit ad177c9561
1 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,7 @@
</template> </template>
<script> <script>
import Locale from 'element-ui/src/mixins/locale';
import { on, off } from 'element-ui/src/utils/dom'; import { on, off } from 'element-ui/src/utils/dom';
import { rafThrottle, isFirefox } from 'element-ui/src/utils/util'; import { rafThrottle, isFirefox } from 'element-ui/src/utils/util';
import { PopupManager } from 'element-ui/src/utils/popup'; import { PopupManager } from 'element-ui/src/utils/popup';
@ -72,7 +73,7 @@ const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel';
export default { export default {
name: 'elImageViewer', name: 'elImageViewer',
mixins: [Locale],
props: { props: {
urlList: { urlList: {
type: Array, type: Array,
@ -234,7 +235,7 @@ export default {
}, },
handleImgError(e) { handleImgError(e) {
this.loading = false; this.loading = false;
e.target.alt = '加载失败'; e.target.alt = this.t('el.image.error');
}, },
handleMouseDown(e) { handleMouseDown(e) {
if (this.loading || e.button !== 0) return; if (this.loading || e.button !== 0) return;