山欲逢晚霞
山欲逢晚霞
  • 发布:2024-08-16 11:28
  • 更新:2024-08-16 11:56
  • 阅读:151

nvue使用web-view真机运行无反应

分类:nvue

<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>

2024-08-16 11:28 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

webview-styles是vue的属性,nvue指定宽高,直接用class,里面写宽高就可以

要回复问题请先登录注册