Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 聚合物应用路由器问题_Javascript_Polymer_Web Component - Fatal编程技术网

Javascript 聚合物应用路由器问题

Javascript 聚合物应用路由器问题,javascript,polymer,web-component,Javascript,Polymer,Web Component,希望有人能帮助我更好地理解使用聚合物应用路由器。我有以下文件-index.html、app.html和updates.html 当我导航到域的根目录时,主布局出现了,但在我试图使用app router元素呈现updates.html文件内容的内容区域中没有显示任何内容,一切都正常工作 非常感谢您的帮助 index.html app.html updates.html 你让它工作了吗?你在哪里使用哪种型号的聚合物? <html> <head> <title>

希望有人能帮助我更好地理解使用聚合物应用路由器。我有以下文件-index.html、app.html和updates.html

当我导航到域的根目录时,主布局出现了,但在我试图使用app router元素呈现updates.html文件内容的内容区域中没有显示任何内容,一切都正常工作

非常感谢您的帮助

index.html

app.html

updates.html


你让它工作了吗?你在哪里使用哪种型号的聚合物?
<html>
<head>
  <title>Example App</title>
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

  <link rel="stylesheet" href="styles/main.css">

  <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="elements/app.html">
</head>

<body fullbleed unresolved>
  <example-app></example-app>
</body> 
</html>
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/core-icons/core-icons.html">
<link rel="import" href="../bower_components/core-item/core-item.html">
<link rel="import" href="../bower_components/core-scaffold/core-scaffold.html">
<link rel="import" href="../bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="../bower_components/core-menu/core-menu.html">
<link rel="import" href="../bower_components/app-router/app-router.html">

<polymer-element name="example-app">
  <template>
    <core-scaffold id="scaffoldPanel">
      <core-header-panel navigation flex>
        <core-toolbar id="navheader" class="tall">
          <img class="middle profile" src="../images/main-carer.png">
        </core-toolbar>
      </core-header-panel>

      <core-toolbar tool flex>
        <div id="main-title" flex><a href="index.html">Example App</a></div>
          <core-icon icon="search"></core-icon>
      </core-toolbar>

      <div class="content">
        <app-router>
          <app-route path="/" import="elements/updates.html" element="app-updates"></app-route>
        </app-router>
      </div>

    </core-scaffold>
  </template>
</polymer-element>
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="app-updates">
  <template>
      <div vertical layout style="height:50px;">
         <div flex class="home-update-menu"><h4>UPDATES</h4></div>
      </div>

      <div>Updates appear here</div>
  </template>
</polymer-element>