[英]Polymer app-router Cordova support
everything work in Chrome but when I export it to Android using Cordova nothing seems to appear. 一切都可以在Chrome中运行,但是当我使用Cordova将其导出到Android时,似乎什么也没有出现。
Only white screen is there. 那里只有白屏。
<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>
This is basically what I've done 基本上这就是我所做的
The issue came down to different platforms using different folder structures following this pattern file://**/www/index.html
. 这个问题归结于遵循此模式
file://**/www/index.html
使用不同文件夹结构的不同平台。
You can solve it by creating 2 routes for the main page like this. 您可以这样为主页创建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://erikringsmuth.github.io/app-router/#/notes#cordova
As he mentioned in the comments, this happens because of file path munging in cordova. 正如他在评论中提到的那样,发生这种情况是由于cordova中的文件路径不足。
I am using a different router, and it works under cordova: https://github.com/atotic/excess-router 我使用的是其他路由器,它可以在cordova下工作: https : //github.com/atotic/excess-router
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.