| 12345678910111213141516171819202122232425262728293031 |
- <script setup lang='ts'>
- import { ref, onMounted, watchEffect } from 'vue'
- import Loading from '@/components/loading.uvue'
- import { router } from '@/.cool'
- const progress = ref(1)
- const webviewSrc = ref('')
- var isLoading = ref(true)
- onMounted(() => {
- webviewSrc.value = router.query().src
- progress.value = router.query().progress
- })
- 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" class="w-full h-full" @message="handleMessage" @load="handleLoad"></web-view>
- </template>
- <style lang="less" scoped></style>
|