首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >来自聚合物的Routing Express在phonegap中不工作

来自聚合物的Routing Express在phonegap中不工作
EN

Stack Overflow用户
提问于 2015-05-11 21:35:13
回答 1查看 411关注 0票数 0

在phonegap中编译我的应用程序后,我在polymer pushstate routing上遇到了问题。我正在尝试使用This github page中的app-router-examples

当我用apache cordova编译我的应用程序时,我的android设备上只有一个空白屏幕。

我的index.html页面中的代码,这是我的主路由器页面。我所有的网页都在/pages目录中

代码语言:javascript
复制
    <!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <title>Project</title>
    <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
    <link rel="stylesheet" href="assets/css/styles.css" shim-shadowdom>
    <link rel="import" href="bower_components/app-router/app-router.html">
    <link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
    <link rel="import" href="bower_components/font-awesome-polymer-icons/fa-icons.html">
    <link rel="import" href="bower_components/font-roboto/roboto.html">
    <link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
    <link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
    <link rel="import" href="bower_components/core-icons/core-icons.html">
</head>
<body fullbleed>

<app-router>
    <app-route path="/" import="/pages/home-page.html"></app-route>
    <app-route path="/login" import="/pages/login-page.html"></app-route>
    <app-route path="/main-page" import="/pages/main-page.html"></app-route>
    <app-route path="/password-remind" import="/pages/password-remind-page.html"></app-route>
    <app-route path="/password-remind-info" import="/pages/password-remind-info-page.html"></app-route>
    <app-route path="/report-step-one" import="/pages/raport-step-one-page.html"></app-route>
    <app-route path="/report-structure" import="/pages/structure-page.html"></app-route>
    <app-route path="/report-progress" import="/pages/progress-page.html"></app-route>
    <app-route path="/contact-page" import="/pages/contact-list.html"></app-route>
    <app-route path="*" import="/pages/not-found-page.html"></app-route>
</app-router>
</body>
</html>

和我的配置xml

代码语言:javascript
复制
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>App</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" version="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>

我的应用程序结构:

EN

回答 1

Stack Overflow用户

发布于 2015-05-11 23:47:19

从本地文件系统加载web组件时,link rel="import"不起作用(例如,使用file://架构)。尝试vulcanize应用程序,以便将web组件捆绑到您的index.html中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30169119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档