SafeView.ets

这个提交包含在:
徐勤民 2024-10-20 15:05:08 +08:00
父节点 919151b0fa
当前提交 72a5497762

查看文件

@ -11,7 +11,7 @@ export interface TitleBarBtn {
@Preview @Preview
@Component @Component
export struct SafeView { export struct SafeView {
@Consume('pageInfos') pageInfos?: NavPathStack pageInfos?: NavPathStack
@Prop isLoading: boolean @Prop isLoading: boolean
// 是不是沉浸式 // 是不是沉浸式
@Prop isImmersive: boolean @Prop isImmersive: boolean
@ -212,10 +212,13 @@ export struct SafeView {
.onBackPressed(() => { .onBackPressed(() => {
if (this.onBackEvent) { if (this.onBackEvent) {
this.onBackEvent() this.onBackEvent()
return true
} else if (this.pageInfos) { } else if (this.pageInfos) {
this.pageInfos.pop() this.pageInfos.pop()
}
return true return true
} else {
return false
}
}) })
} }
} }