Polymer 1.0 Cordova,¿我怎么能改变主页的方向?

时间:2016-01-24 18:35:42

标签: html css cordova polymer polymer-1.0

每当我启动应用时,始终以地址http://127.0.0.1:49218/www/index.html#!/www/index.html开头,但我想从地址开始:http://127.0.0.1:49218/www/index.html#!/home,这是我应用中的“主页(Inicio)”部分。这是我的代码:

<!DOCTYPE html>
<html>

<head>
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
    <link rel="stylesheet" href="css/style.css">
    <link rel="import" href="bower_components/polymer/polymer.html">
    <link rel="import" href="bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html">
    <link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html">
    <link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
    <link rel="import" href="bower_components/iron-icons/iron-icons.html">
    <link rel="import" href="bower_components/iron-icon/iron-icon.html">
    <link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html">
    <link rel="import" href="bower_components/paper-menu/paper-menu.html">
    <link rel="import" href="bower_components/paper-styles/paper-styles.html">
    <link rel="import" href="bower_components/paper-styles/typography.html">
    <link rel="import" href="bower_components/pushstate-anchor/pushstate-anchor.html">
    <link rel="import" href="bower_components/iron-pages/iron-pages.html">
    <link rel="import" href="bower_components/neon-animation/neon-animated-pages.html">
    <link rel="import" href="bower_components/neon-animation/neon-animations.html">
    <link rel="import" href="catalogo-component/catalogo-component.html">
    <link rel="import" href="home-component/home-component.html">
    <link rel="import" href="promociones-component/promociones-component.html">
    <link rel="import" href="contacto-component/contacto-component.html">
    <link rel="import" href="about-component/about-component.html">
    <link rel="import" href="elements/routing.html">
    <link rel="import" href="css/app-theme.html">
    <style is="custom-style" include="app-theme.html"></style>
    <title>Reino Unido</title>
</head>

<body unresolved>
    <span id="browser-sync-binding"></span>
    <template is="dom-bind" id="app">
        <paper-drawer-panel>
            <paper-scroll-header-panel drawer fixed>
                <div drawer class="menu">
                    <paper-toolbar class="drawer">
                        <span>Reino Unido</span>
                    </paper-toolbar>
                    <paper-menu attr-for-selected="data-route" selected="[[route]]">
                        <a data-route="home" href="/home">
                            <iron-icon icon="home"></iron-icon><span class="Menu">Inicio</span></a>
                        <a data-route="catalogo" href="/catalogo">
                            <iron-icon icon="shopping-cart"></iron-icon><span class="Menu">Catálogo</span></a>
                        <a data-route="promociones" href="/promociones">
                            <iron-icon icon="star"></iron-icon><span class="Menu">Promociones</span></a>
                        <a data-route="contacto" href="/contacto">
                            <iron-icon icon="drafts"></iron-icon><span class="Menu">Contáctanos</span></a>
                        <a data-route="about" href="/about">
                            <iron-icon icon="info"></iron-icon><span class="Menu">Acerca de</span></a>
                    </paper-menu>
                </div>
            </paper-scroll-header-panel>
            <paper-scroll-header-panel main id="headerPanelMain" condenses keep-condensed-header>
                <div main class="page">
                    <paper-toolbar class="main">
                        <paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button>
                        <span title class="flex">Inicio</span>
                        <paper-icon-button icon="refresh"></paper-icon-button>
                    </paper-toolbar>
                    <neon-animated-pages attr-for-selected="data-route" selected="{{route}}" class="secciones" entry-animation="slide-from-right-animation" exit-animation="slide-left-animation">
                        <section data-route="home">
                            <home-component></home-component>
                        </section>

                        <section data-route="catalogo">
                            <catalogo-component></catalogo-component>
                        </section>

                        <section data-route="promociones">
                            <promociones-component></promociones-component>
                        </section>

                        <section data-route="contacto">
                            <contacto-component></contacto-component>
                        </section>

                        <section data-route="about">
                            <about-component></about-component>
                        </section>
                    </neon-animated-pages>
                </div>
            </paper-scroll-header-panel>
        </paper-drawer-panel>
    </template>
</body>

</html>

以下是应用的截图:

enter image description here

1 个答案:

答案 0 :(得分:1)

尝试编辑config.xml中的内容标记。它可能看起来像这样:

<content src="index.html" />

只需更改src值即可满足您的需求。