| | |
| | | <template> |
| | | <div class="bg-white"> |
| | | |
| | | <iframe |
| | | ref="iframeRef" |
| | | src="http://www.xpump.net/iie-mobile?v=3333233332" |
| | | class="w-full h-full border-none overflow-hidden" |
| | | ></iframe> |
| | | <iframe ref="iframeRef" :src="url" class="w-full h-full border-none overflow-hidden"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | const emit = defineEmits(['close']); |
| | | |
| | | import { ref, onMounted } from 'vue'; |
| | | import { ChildRegister } from '@/utils/iframeCall'; |
| | | const getUrl = () => { |
| | | const isDev = import.meta.env.DEV; |
| | | if (isDev) { |
| | | return 'http://localhost:5679'; |
| | | } |
| | | return 'http://www.xpump.net/iie-mobile?v=132323'; |
| | | }; |
| | | |
| | | const url = getUrl(); |
| | | |
| | | const iframeRef = ref<HTMLIFrameElement>(); |
| | | |
| | |
| | | window.addEventListener('message', (event) => { |
| | | if (event.data.type === 'close') { |
| | | emit('close'); |
| | | } else if (event.data.type === 'childIsReady') { |
| | | console.log('🚀 ~ child is ready',); |
| | | ChildRegister.registerNotifyFunction(); |
| | | } |
| | | }); |
| | | }); |