第一步,在app.vue中添加条件编译内容如下
// #ifdef APP-PLUS
onLaunch() {
plus.screen.lockOrientation("portrait-primary")
}
// #endif
第二步,在manifest.json中配置如下内容
"app-plus": {
"distribute": {
"distribute": {
"orientation": ["portrait-primary"] //重力感应、横竖屏配置
}
},