页面A
<template>
<view class="content">
<text class="title" @click="onLink()">跳转</text>
</view>
</template>
<script>
export default {
methods: {
onLink() {
uni.navigateTo({
url: '/pages/web/index'
})
}
}
};
</script>
<style>
.content {
background: #fff;
flex: 1;
}
.title {
font-size: 36rpx;
color: #007AFF;
}
</style>
页面B
<template>
<view class="page"></view>
</template>
<script>
export default {
onLoad() {
const page = this.$scope.$getAppWebview()
const web = plus.webview.create('https://baidu.com', 'custom', {
top: uni.getSystemInfoSync().statusBarHeight + 44,
bottom: 0,
})
page.append(web)
web.show()
},
};
</script>
<style>
.page {
background: #f5f5f5;
}
</style>