1.uniapp下
横屏页面
<template>
<web-view v-if="path" :src="path" />
</template>
<script>
export default {
data() {
return {
path: '',
}
},
onLoad(options) {
this.path = JSON.parse(decodeURI(options.data))
},
onUnload() {
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary');
// #endif
}
}
</script>
<style>
</style>
2.uniapp下
竖屏页面
<template>
<web-view :src="path" />
</template>
<script>
export default {
data() {
return {
path: '',
}
},
onLoad(options) {
plus.screen.lockOrientation('portrait-primary');
this.path = '竖屏h5页面‘
},
onUnload() {
plus.screen.lockOrientation('portrait-primary');
},
}
</script>
<style>
</style>
3.竖屏h5页面内跳转代码
let data = '横屏h5页面url’
uni.webView.navigateTo({
url: '/pages/横屏路由?data=' + encodeURI(JSON.stringify((data)))
})
3 个回复
2***@qq.com (作者)
这么基础的问题,没有人遇到么?
chenli
建议上传可复现简单的示例工程,能附上操作视频或者GIF图更好。这样方便他人可以更好的理解和排查分析问题!
2***@qq.com (作者)
http://47.244.172.180/video/bug.zip
2022-01-05 16:30
2***@qq.com (作者)
示例放到我服务器了
2022-01-05 16:30
DCloud_UNI_LXH
提供一个可复现的示例看看
2***@qq.com (作者)
不能发zip..
2022-01-05 16:23
2***@qq.com (作者)
我邮箱 2291172314@qq.com
2022-01-05 16:23
2***@qq.com (作者)
私信邮箱 或直接加qq,我发示例(含文档视频)
2022-01-05 16:24
2***@qq.com (作者)
http://47.244.172.180/video/bug.zip
2022-01-05 16:30
2***@qq.com (作者)
示例放到我服务器了
2022-01-05 16:30
2***@qq.com (作者)
在么,大佬
2022-01-06 16:02