Polymer:Uncaught TypeError:this。$$(...)。fire不是函数

时间:2017-02-16 08:20:48

标签: javascript polymer

选择器和触发器工作,很少失败并抛出此错误,这发生在Chrome 55和56上,在Windows 7,8.1,10和osx 10.12上 热衷于理解为什么会发生这种情况以及后退会是什么样子

<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-pages/iron-pages.html">
<dom-module id="app-pages">

  <template>

    <style>

      :host {
        display: block;
      }

      .Page {
        opacity: 0;
        transition: 0.5s opacity;
      }

    </style>

    <iron-pages selected="[[page]]" selected-attribute="active"
                attr-for-selected="id" fallback-selection="404">
      <app-page-street class="Page" id="street" route="{{route}}" app="{{app}}"></app-page-street>
      <app-page-404 class="Page" id="404" route="{{route}}" app="{{app}}"></app-page-404>
      <app-page-photo-picker class="Page" id="photo-picker" route="{{route}}" app="{{app}}"></app-page-photo-picker>

    </iron-pages>

  </template>

  <script>

    Polymer({

      is: 'app-pages',
      listeners: {
        'navNext': '_navNext',
        'doLookup': 'doLookup'
      },
      properties: {
        app: Object,

        page: {
          type: String,
          reflectToAttribute: true
        },

        route: Object
      },
      doLookup:function () {
        this.$.edit.fire('navNextc');
      },
      _navNext: function(){
        this.$$('.Page[active]').fire('navNextc');
      }

    });

  </script>

</dom-module>

0 个答案:

没有答案