2017-08-27 54 views
4

我使用离子Deeplinker deeplinker打破在离子网页(浏览器)应用3离子在刷新

一切通过URL传递PARAMS当这样的伟大工程:

http://localhost:8100/#/redeem/593f2ac1e839b689d883448d

哈弗,当我刷新我的应用程序,我得到:

Uncaught (in promise): invalid link: redeem/593f2ac1e839b689d883448d 

我使用IonicPage装饰像这样:

@IonicPage({ 
    name: 'redeem', 
    segment: 'redeem/:id', 
    defaultHistory: ['reward-goals'] 
}) 

为什么当我刷新页面时,出现错误?

请注意:没有参数没有添加到路由它工作正常:

http://localhost:8100/#/redeem

因此,一些有关路由参数导致了问题。

更新: 当部署我的应用程序,一切工作正常,但我仍然看到控制台中的错误。 enter image description here

+0

只需添加引用[问题](https://github.com/ionic-team/ionic/issues/12765 )... –

回答

1

我发现了这个问题。在离子含量deeplinker: enter image description here

而且...... enter image description here

他们需要做的组件名称的字符串匹配。或者需要把所有的东西都拿到第一个/并与之匹配。我已经提交了一份bug报告..

**** UPDATE ****** 我改变离子含量代码这个...

UrlSerializer.prototype.getLinkFromName = function (nameOrComponent) { 
     return this.links.find(function (link) { 
      return (link.component === nameOrComponent) 
         || (link.name === nameOrComponent) 
         || (nameOrComponent.indexOf(link.name)>-1); //added this line 
     }); 
    }; 

,它工作正常。我希望在即将到来的版本中看到这个补丁。我确定这也可以放在索引页的底部作为补丁现在..

+0

你能发送一个链接到你的问题吗? –

+0

找到它了:https://github.com/ionic-team/ionic/issues/12765 –