Ember project 发布了包括 Ember.js、Ember Data 和 Ember CLI 的 3.11 版本。
新特性:
...attributes
:这个特性阐明了“splattributes”特性如何与元素修饰符交互{{fn}}
支持其他高级用例,例如向现有函数添加更多参数
Current count: {{this.count}}
{{!-- when not passing arguments, these are equivalent --}}
<MyButton @click={{this.countUp}}>Add One</MyButton>
<MyButton @click={{fn this.countUp}}>Add One</MyButton>
{{!-- calls this.countUp(10) when clicked --}}
<MyButton @click={{fn this.countUp 10}}>Add Ten</MyButton>
Current count: {{this.count}}
<button {{on "click" this.countUp passive=true}}>Add One</button>
新特性:
以前
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo, hasMany } from 'ember-data/relationships';
或者
import DS from 'ember-data';
const { Model, attr, belongsTo, hasMany } = DS;
现在
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
Ember CLI 只是修复了几个 bug。
升级命令:
npm install -g ember-cli-update
ember-cli-update