0

<sui-accordion-panel>应该在 IE11 中展开,但Object doesn't support property or method 'animate'错误却出现在 IE 控制台窗口中。

脚步

我将<sui-accordion>嵌套添加<sui-accordion-panel>到其中一个视图中。代码如下所示:

//... other components 
  <div [hidden]="!isCreateNewFlag">
    <sui-accordion>
      <sui-accordion-panel [isOpen]="false">
        <div title>
          <i class="dropdown icon"></i>
          <b>Additional options</b>       
        </div>
        <div content>
          <p>Upload initial answer file. (Select the template first.)</p>
          <app-file-uploader acceptedFormat=".anx" [isDisabled]="fileUploaderDisabled" [isFileValid]="isAnswerFileValid"
            (fileUploadedEvent)="onFileUploadedEvent($event)"></app-file-uploader>
        </div>
      </sui-accordion-panel>
    </sui-accordion>
  </div>

</app-form-modal>

我创建的<app-file-uploader>不是问题——即使我从上面的代码中删除它,我对手风琴组件也有同样的问题。

预期结果

屏幕截图显示了 chrome Web 浏览器中的预期行为。 图片

实际结果

扩展的东西在 IE11 中不起作用: 图片

版本

这就是我的 package.json 的样子:

{
  "name": "hd",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "generate-api-client": "call ../../Build/GenerateApiClient.bat",
    "predevbuild": "cpx ./src/styles/theme.config ./node_modules/semantic-ui-less/",
    "devbuild": "ng build --output-hashing none",
    "prebuild": "cpx ./src/styles/theme.config ./node_modules/semantic-ui-less/",
    "build": "ng build --prod --output-hashing none",
    "watch": "ng build --output-hashing none --watch",
    "test": "ng test --sourceMap=false --watch false",
    "test-watch": "ng test --sourceMap=false",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.7",
    "@angular/common": "6.0.7",
    "@angular/compiler": "6.0.7",
    "@angular/core": "6.0.7",
    "@angular/forms": "6.0.7",
    "@angular/http": "6.0.7",
    "@angular/platform-browser": "6.0.7",
    "@angular/platform-browser-dynamic": "6.0.7",
    "@angular/router": "6.0.7",
    "core-js": "2.5.7",
    "date-fns": "1.29.0",
    "element-resize-detector": "1.1.14",
    "lodash-es": "4.17.10",
    "ng2-semantic-ui": "0.9.7",
    "rxjs": "6.2.1",
    "semantic-ui-calendar": "0.0.8",
    "semantic-ui-less": "2.3.3",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.6.8",
    "@angular/cli": "6.0.8",
    "@angular/compiler-cli": "6.0.7",
    "@angular/language-service": "6.0.7",
    "@types/element-resize-detector": "1.1.0",
    "@types/jasmine": "2.8.8",
    "@types/jasminewd2": "2.0.3",
    "@types/lodash-es": "4.17.0",
    "@types/node": "10.5.3",
    "codelyzer": "4.4.2",
    "cpx": "1.5.0",
    "jasmine": "3.1.0",
    "jasmine-core": "3.1.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "2.0.4",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "2.0.1",
    "karma-jasmine": "1.1.2",
    "karma-jasmine-html-reporter": "1.2.0",
    "less": "2.7.3",
    "protractor": "5.3.2",
    "ts-node": "7.0.0",
    "tslint": "5.10.0",
    "typescript": "2.7.2"
  }
}

您是否知道可能出了什么问题,是否有解决此问题的方法?干杯

4

1 回答 1

1

并非所有浏览器都支持<sui-accordion>正在使用。Web Animations API他们在这里的文档中告诉它:

为了更好地解决这个问题,我建议将其添加到您的polyfill.ts文件中(可能已经有评论):

import 'web-animations-js';  

要完成这项工作,您需要运行:npm install --save web-animations-js.

您可以在此处查看实时示例:

https://stackblitz.com/edit/angular-stack-55650439?file=src%2Fpolyfills.ts

于 2019-04-12T11:56:16.947 回答