Huanyuyuehui/pages/annex/web_view/index.vue

32 lines
590 B
Vue
Raw Normal View History

2024-03-21 17:52:58 +08:00
<template>
<web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
</template>
<script>
2024-03-21 18:05:36 +08:00
2024-03-21 17:52:58 +08:00
export default {
data() {
return {
windowH: 0,
windowW: 0,
webviewStyles: {
progress: {
color: 'transparent'
}
},
url: ''
}
},
onLoad(option) {
this.url = decodeURIComponent(option.url);
try {
const res = uni.getSystemInfoSync();
this.windowW = res.windowWidth;
this.windowH = res.windowHeight;
} catch (e) {
// error
}
}
}
</script>