<template>
<view class="container" :style="{ height: pHeight }">
<web-view id="webview" ref="webview" :src="src" :webview-styles="{ width: pWidth, height: pHeight}"></web-view>
</view>
</template>
<script>
import io from '@hyoga/uni-socket.io'
export default {
data() {
return {
src: '',
pHeight: '',
pWidth: ''
}
},
created() {},
mounted() {
let that = this
uni.getSystemInfo({
success: function (res) {
that.pHeight = res.safeArea.height + 'px'
that.pWidth = res.safeArea.width + 'px'
}
});
this.src = '/hybrid/html/live_a_human.html'
},
methods: {}
}
</script>
1 个回复
DCloud_UNI_yuhe
webview-styles是vue的属性,nvue指定宽高,直接用class,里面写宽高就可以