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
[admin
]