Polymer 2网站在IE 11中不起作用

时间:2018-02-28 06:16:12

标签: javascript polymer internet-explorer-11 polymer-2.x

我被困在一件事上。 Polymer 2网站在Chrome和firefox中运行顺利,但在IE中显示开发人员工具控制台中的错误。它在聚合物类声明中显示语法错误。



class MyApp extends Polymer.Element {
    static get is() { return 'my-app'; }
} 



 同时显示"预期:"在na-behavior.html。



(function() {
    'use strict';

    Polymer.NoteAppBehaviorImpl = {
      properties: {
        editableNoteId: {
          type: String,
          notify: true
        }
      },

      get notesPath() {
        return '';
      },

      get isEditable() {
        return true;
      },

      toEditableId: function(noteId) {
        return noteId;
      },

      edit: function(event) {
        if (this.isEditable) {
          var noteElement = Polymer.dom(event).localTarget;
          this.editableNoteId = this.toEditableId(noteElement.id);

          this.$.document.transactionsComplete.then(function() {
            this.$.editor.open(noteElement);
          }.bind(this));
        }
      },

      create: function() {
        if (this.isEditable) {
          this.editableNoteId = null;
          this.$.editor.open();
        }
      },

      commitChange: function(event) {
        var changeCommits;

        switch (event.detail) {
          case 'save':
            changeCommits = this.save();
            break;
          case 'delete':
            changeCommits = this.delete();
            break;
          default:
            changeCommits = Promise.resolve();
            break;
        }

        if (this.$.query && this.$.query.refresh) {
          changeCommits.then(function() {
            this.$.query.refresh();
          }.bind(this));
        }
      },

      save: function() {
        if (this.$.document.isNew &&
            (this.editableNote.title ||
             this.editableNote.body)) {
          return this.$.document.save(this.notesPath).then(function() {
            this.$.document.reset();
          }.bind(this));
        }

        return Promise.resolve();
      },

      delete: function() {
        if (!this.$.document.isNew) {
          this.$.document.destroy();
        }

        return Promise.resolve();
      },

      signOut: function() {
        if (this.$.auth) {
          this.$.auth.signOut();
        }
      }
    };

    /** @polymerBehavior */
    Polymer.NoteAppBehavior = [
      Polymer.AppNetworkStatusBehavior,
      Polymer.NoteAppBehaviorImpl
    ];
  })();




它有什么问题。有人能帮帮我吗?如果您需要更多信息,请认识我。

0 个答案:

没有答案