nvue页面,使用web-view组件,加载h5链接
<template>
<view>
<web-view
ref="webview"
:style="{
position: 'fixed',
top: marginTop + 'px',
left: 0,
width: screenWidth + 'px',
height: (screenHeight - marginTop) + 'px'
}"
:src="url"
:update-title="false"
@onPostMessage="onPostMessage"
/>
</view>
</template>
onLoad(opt) {
const systemInfo = uni.getSystemInfoSync()
const statusBarHeight = systemInfo.statusBarHeight
this.marginTop = 56 + statusBarHeight
this.screenWidth = systemInfo.screenWidth
this.screenHeight = systemInfo.screenHeight
this.url = 'https://www.baidu.com/'
}