歡迎您光臨本站 註冊首頁

Ember 3.11 發布,JavaScript Web 應用開發框架

←手機掃碼閱讀     admin @ 2019-07-18 , reply:0

Ember project 發布了包括 Ember.js、Ember Data 和 Ember CLI 的 3.11 版本。

1、Ember.js 是構建 Web 應用程序的核心框架,Ember.js 3.11 是一個漸進的、向後兼容的 Ember 發行版

新特性:

  • Forwarding Element Modifiers...attributes:這個特性闡明了「splattributes」特性如何與元素修飾符交互
  • {{fn}}助手:提供了一種將參數傳遞給操作的方法,{{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>

  • {{ON}}修飾符提供了一種直接的方式來偵聽任意元素上的 DOM 事件

Current count: {{this.count}}

<button {{on "click" this.countUp passive=true}}>Add One</button>

 

  • 注入參數規範化使所有 Ember 基類(即由 Ember 提供的框架類)的合同規範化

 2、Ember Data 是 Ember.js 應用程序的官方數據持久性庫

新特性:

  • 包:引入一種新的導入語法

以前 


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';

 

3、Ember CLI 是用於管理和打包 Ember.js 應用程序的命令行介面

Ember CLI 只是修復了幾個 bug。

升級命令:


npm install -g ember-cli-update
ember-cli-update

發布說明


[admin ]

來源:OsChina
連結:https://www.oschina.net/news/108325/ember-3-11-released
Ember 3.11 發布,JavaScript Web 應用開發框架已經有224次圍觀

http://coctec.com/news/all/show-post-210140.html