我们计划在我们的新产品中使用 Aurelia,并尝试做简单的 POC Aurelia 示例,我在 IE11 中遇到问题。任何人都可以帮助解决这个问题。
谢谢你的帮助。
我使用此链接中的以下命令创建了此示例:
jspm install aurelia-framework
jspm install aurelia-bootstrapper
错误:
无法定义属性“Symbol(id)_h.zlr3taf0m51”:对象不可扩展
包.json
{
"jspm": {
"directories": {
"lib": "src"
},
"dependencies": {
"aurelia-bootstrapper": "^0.11.0",
"aurelia-framework": "^0.10.0",
"aurelia-logging-console": "^0.3.0",
"es6-collections": "github:webreflection/es6-collections@master",
"mutationobservers": "github:polymer/mutationobservers@^0.4.2"
}
}
}
索引.html
<html>
<head>
<title>Hello from Aurelia</title>
</head>
<body aurelia-app>
<div class="splash">
<div class="message">Aurelia Navigation Skeleton</div>
<i class="fa fa-spinner fa-spin"></i>
</div>
<script src="jspm_packages/github/webreflection/es6-collections@master/es6-collections.js"></script>
<script src="jspm_packages/github/polymer/mutationobservers@0.4.2/MutationObserver.js"></script>
<script src="jspm_packages/github/webcomponents/webcomponentsjs@0.5.5/HTMLImports.js"></script>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('main').catch(console.error.bind(console));
</script>
main.js
import {LogManager} from 'aurelia-framework';
import {ConsoleAppender} from 'aurelia-logging-console';
import {bootstrap} from 'aurelia-bootstrapper';
LogManager.addAppender(new ConsoleAppender());
LogManager.setLevel(LogManager.levels.debug);
export function configure(aurelia) {
aurelia.use
.defaultBindingLanguage()
.defaultResources()
.router()
.eventAggregator()
aurelia.start().then(a => a.setRoot('app', document.body));
}
应用程序.js
export class App {
constructor() {
this.message = "";
}
activate() {
this.message = "Hello, World!";
}
changeMessage() {
this.message = "Goodbye!";
}
}
应用程序.html
<template>
<div>
<div>${message}</div>
<button click.trigger="changeMessage()">Say Goodbye</button>
</div>
</template>