如何使用聚合物正确导入html

时间:2018-05-28 05:35:13

标签: polymer vaadin

使用聚合物导入html文件时遇到问题。 这是我的html文件:

<link rel="import" href="shared-styles.html">
<link rel="import" href="404.html">
<link rel="import" href="admin-grid.html">
<link rel="import" href="admin-sort.html">
<link rel="import" href="breadcrumb.html">
<link rel="import" href="button.html">
<link rel="import" href="car-detail.html">
...

我将这些文件与all-views.html捆绑在一起。使用它

<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<link rel="import" href="/frontend/ui/all-views.html">
<dom-module id="main-page">
    <template>
        <div id="content">
            <header-layout id="header" class="black"></header-layout>
            <div id="slide" class="slide"></div>
            <div id="container">
                <div id="home-brands">
                    <template is="dom-repeat" items="[[brands]]">
                        <a class$="[[item.part]]" disabled$="{{_getDisabled(page.link)}}" router-link="" href$="[[item.link]]">
                            <img class="car-brand" src$="{{item.backgroundImage}}"></img>
                            <div class="overlay"></div>
                            <img class="port" src$="{{item.icon}}"></img>
                            <template is="dom-if" if="{{!item.icon}}">
                                <div class="certified">[[item.title]]</div>
                            </template>
                        </a>
                    </template>
                </div>
                <div class="news">
                    <div class="news-left">
                        <span class="title">{{topNews}}</span>
                        <div id="single-news"></div>
                    </div>
                    <div id="news-right" class="news-right"></div>
                </div>
                <div class="other">
                    <div id="job" class="job"></div>
                    <div id="proof" class="proof"></div>
                    <div id="assignment" class="assignment"></div>
                </div>
                <div id="order" class="order"></div>
            </div>
            <div id="part" class="part">
                <div id="partWrapper" class="wrapper"></div>
            </div>
            <div class="used-cars">
                <div class="wrapper">
                    <div id="used-cars"></div>
                </div>
            </div>
            <footer-layout id="footer"></footer-layout>
        </div>
    </template>
    <script>
    class MainPage extends Polymer.Element {
        static get is() {
            return 'main-page'
        }

        _getDisabled(value){
            return value == null || value == undefined ? "disabled" : "";
        }
    }

    customElements.define(MainPage.is, MainPage);
    </script>
</dom-module>

但上面给了我:(index):2 Uncaught Application ROOT-2521314 is already being initialized。我做错了什么 ?

0 个答案:

没有答案