HarmonyOS 首页进入组件页面后执行this.pageInfos.pop()返回首页后不执行onPageShow生命周期函数
build() {
Navigation(this.pageInfos) {
Scroll() {
Column() {
//初始化地图
// this.buildMapShow()
Button('API自动化导航组件', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'NaviCompositeApi' })
// router.pushUrl({
// url: 'pages/composite/NaviTestIndex'
// })
})
Button('导航组件', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'NaviComposite' })
})
Button('导航组件(货车)', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'TruckNaviComposite' })
})
Button('公共组件', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'CommonComposite' })
})
Button('语音播报', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'TextToSpeech' })
})
Button('导航管理-开始导航', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'DriveNaviNoMap' })
})
Button('显示地图', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'ShowMapTest' })
})
Button('定位设置', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'DemoGlobalSetting' })
})
Button('模拟定位', { stateEffect: true, type: ButtonType.Capsule })
.width('80%')
.height(40)
.margin(20)
.onClick(() => {
this.pageInfos.pushPath({ name: 'MockLocation' })
})
}
}
}
.title('导航Demo')
.navDestination(this.PageMap)
.mode(NavigationMode.Stack)
.titleMode(NavigationTitleMode.Full)
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS Component生命周期函数 onPageShow()不生效
1825浏览 • 1回复 待解决
通过Navigation触发的页面跳转,目标页面的生命周期函数不执行
687浏览 • 1回复 待解决
HarmonyOS 首页组件生命周期问题
731浏览 • 1回复 待解决
HarmonyOS Navigation从第二页返回首页,没回调首页的onPageShow
799浏览 • 1回复 待解决
HarmonyOS 页面跳转时,生命周期函数没有触发
978浏览 • 1回复 待解决
HarmonyOS 关于组件重绘的生命周期函数
1059浏览 • 1回复 待解决
如何使用AbilityStage的生命周期函数
3527浏览 • 1回复 待解决
HarmonyOS 使用nav模式关闭页面,aboutToDisappear生命周期异常慢,有时候调用pop方法后需要等待800ms才会执行到页面的aboutToDisappear生命周期
513浏览 • 1回复 待解决
HarmonyOS页面onPageShow生命周期不回调
1842浏览 • 1回复 待解决
HarmonyOS 生命周期函数可以改成异步的吗
755浏览 • 1回复 待解决
HarmonyOS 自定义组件生命周期回调有没有build执行后的回调
964浏览 • 1回复 待解决
#鸿蒙通关秘籍#鸿蒙应用和页面生命周期函数使用详解
1183浏览 • 1回复 待解决
HarmonyOS 首页lottie动画一直执行,页面跳转之后还在执行
604浏览 • 1回复 待解决
HarmonyOS 有没有页面每次出现都执行的生命周期方法
566浏览 • 1回复 待解决
HarmonyOS 组件aboutToAppear生命周期函数,在未到达页面时开始调用,导致访问数据报错
845浏览 • 1回复 待解决
HarmonyOS requestModalUIExtension 接口拉起UIEXtensionAbility,会调用onWindowStageCreate生命周期函数吗
525浏览 • 1回复 待解决
HarmonyOS 能在页面进入前执行接口请求逻辑 而不是在页面生命周期内执行数据请求 减少页面等待时间
680浏览 • 1回复 待解决
HarmonyOS Entry页面与子组件的生命周期执行顺序是怎么样的
963浏览 • 1回复 待解决
HarmonyOS TabContent页面生命周期不触发
1330浏览 • 1回复 待解决
HarmonyOS 页面组件的生命周期、自定义组件生命周期监听问题
1044浏览 • 1回复 待解决
HarmonyOS 是否有支持应用生命周期、页面生命周期、组件生命周期Hook的API?
1316浏览 • 0回复 待解决
HarmonyOS @Entry标注的组件onPageShow方法不执行
723浏览 • 1回复 待解决
是否可以在应用程序中手动调用page的生命周期函数
2791浏览 • 1回复 待解决
HarmonyOS 生命周期不触发
698浏览 • 1回复 待解决
参考以下代码,首页3s后自动跳转,跳转后点击返回首页,回调onShown方法,3s后再次自动跳转: