gpt4 book ai didi

ionic-framework - Ionic 4 中的深层链接如何工作?

转载 作者:行者123 更新时间:2023-12-03 17:30:30 26 4
gpt4 key购买 nike

我正在尝试在 ionic 4 中使用深层链接,但无法成功。

在 app.component.ts 中:
@ViewChild(IonNav) 导航:IonNav;

        this.deeplinks.routeWithNavController(this.nav, {
'/auth/password/reset/:authToken': 'ForgotPasswordPage'
})
.subscribe((match) => {
}, (nomatch) => {
});

在忘记密码.page.ts
this.authToken=this.route.snapshot.paramMap.get('authToken')

但是当我点击链接时,它会打开应用程序而不是 ForgotPassword 页面并给出此错误: 无法读取未定义的属性“推送”

最佳答案

我想我通过将 deeplink 路由器调用包装在 app.component.ts 代码中来解决推送问题:

ngAfterViewInit() {
this.platform.ready().then(() => { .. deeplink code here .. })
}

但是,当深度链接到达时,我遇到了一个问题,即没有组件工厂来处理页面对象并且在深度链接模块中引发了错误。

关于ionic-framework - Ionic 4 中的深层链接如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55238818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com