首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
Ember 3.11 发布,JavaScript Web 应用开发框架
2019年7月18日 13:02 | 阅读 765 次

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

发布说明




评论 (0)
游客请输入验证码
最新评论
0
0
收藏