| 123456789101112131415161718192021222324252627282930 |
- <script setup lang='ts'>
- import { ref, onMounted, watchEffect } from 'vue'
- import Loading from '@/components/loading.uvue'
- import { router } from '@/.cool'
- const webviewSrc = ref('')
- var isLoading = ref(true)
- onMounted(() => {
- webviewSrc.value = router.query().src
- })
- function handleMessage(e) {
- var pages = getCurrentPages();
- const prevPage = pages[pages.length - 2];
- (prevPage as any).status = "success"
- }
- function handleLoad() {
- isLoading.value = false
- console.log('handleLoad')
- }
- onShow(() => {
- var pages = getCurrentPages();
- const prevPage = pages[pages.length - 2];
- (prevPage as any).status = "test"
- })
- </script>
- <template>
- <Loading v-show="isLoading" />
- <web-view :src="webviewSrc + '?' + Math.random()" class="w-full h-full" @message="handleMessage"
- @load="handleLoad"></web-view>
- </template>
- <style lang="less" scoped></style>
|