| | |
| | | */ |
| | | import type { VerificationProps } from './typing'; |
| | | |
| | | import { defineAsyncComponent, markRaw, ref, toRefs, watchEffect } from 'vue'; |
| | | import { |
| | | computed, |
| | | defineAsyncComponent, |
| | | markRaw, |
| | | nextTick, |
| | | ref, |
| | | toRefs, |
| | | watchEffect, |
| | | } from 'vue'; |
| | | |
| | | import { IconifyIcon } from '../../../../../../icons/src'; |
| | | |
| | |
| | | }; |
| | | |
| | | const show = () => { |
| | | if (mode.value === 'pop') showBox.value = true; |
| | | if (mode.value === 'pop') { |
| | | showBox.value = true; |
| | | // 每次打开按当前视口重新计算尺寸,适配移动端 |
| | | nextTick(() => instance.value?.init?.()); |
| | | } |
| | | }; |
| | | |
| | | /** 弹窗最大宽度,避免窄屏溢出 */ |
| | | const boxMaxWidth = computed(() => { |
| | | const width = Number.parseInt(String(props.imgSize.width)); |
| | | const limit = |
| | | typeof window === 'undefined' ? 420 : window.innerWidth - 24; |
| | | return `${Math.min(width + 20, limit)}px`; |
| | | }); |
| | | |
| | | const onError = (proxy: any) => { |
| | | emit('onError', proxy); |
| | |
| | | <div v-show="showBox"> |
| | | <div |
| | | :class="mode === 'pop' ? 'verifybox' : ''" |
| | | :style="{ 'max-width': `${parseInt(imgSize.width) + 20}px` }" |
| | | :style="{ 'max-width': boxMaxWidth }" |
| | | > |
| | | <div v-if="mode === 'pop'" class="verifybox-top"> |
| | | {{ $t('ui.captcha.title') }} |