聚合物应用路由器科尔多瓦支持



一切都可以在Chrome中运行,但是当我使用Cordova将其导出到Android时,似乎没有任何内容出现。

只有白屏。

<body unresolved fullbleed>
 <app-router>
  <app-route path="/" import="/elements/kwikblood-fblogin.html"></app-route>
  <app-route path="/panel" import="/elements/kwikblood-panel.html"></app-route>
 </app-router>
 <script src="scripts/app.js"></script>
</body>

这基本上就是我所做的

问题

归结为不同的平台,按照这种模式使用不同的文件夹结构file://**/www/index.html

您可以通过像这样为主页创建 2 条路由来解决它。

<app-router>
  <app-route path="/" import="pages/home-page.html"></app-route>
  <app-route path="/**/www/index.html" import="pages/home-page.html"></app-route>
  <app-route path="*" import="pages/not-found.html"></app-route>
</app-router>

https://erikringsmuth.github.io/app-router/#/notes#cordova

正如他在评论中提到的,发生这种情况是因为科尔多瓦中的文件路径被修改。

我正在使用不同的路由器,它可以在科尔多瓦下工作:https://github.com/atotic/excess-router

最新更新