shop-applet/pages/annex/web_view/index.vue

31 lines
587 B
Vue
Raw Permalink Normal View History

2023-09-20 18:16:59 +08:00
<template>
<web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
</template>
<script>
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>