发布于 2015-05-17 22:54:17 | 232 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Vue.js 教程,程序狗速度看过来!

Vue.js 轻量级 JavaScript 框架

Vue.js 是构建 Web 界面的 JavaScript 库,提供数据驱动的组件,还有简单灵活的 API,使得 MVVM 更简单。


此版本更新内容如下:

改进

  • paramAttributes option has been renamed to props.

  • v-with has been removed. Now props are the only way to pass data to a child component.

  • v-component has been removed. Now all components should use the custom tag syntax. For dynamic components, a new syntax is introduced: <component type="{{view}}"></component>.

  • v-partial and {{> partial}} have been removed.

目标是移除 API 的一些 cruft。

新特性

  • 异步组件。示例:

    components: {  async: function (resolve) {    setTimeout(function () {
          resolve({
            template: '<div>I am async!</div>'
          })
        }, 1000)
      }
    }
  • elementDirectives。示例:

    Vue.elementDirective('my-stuff', {  update: function () { /* ... */ }
    })
    <my-stuff></my-stuff>

优化

  • props now support explicit one-way binding with the syntax of prop="{{* oneway}}"

  • props can now contain multiple mustache tags, e.g. prop="{{a}} b"

  • props can now contain filters, e.g. prop="{{a | reverse}}"

  • props can now contain expressions, e.g. prop="{{a + b}}"

  • When a prop's parent expression is not "settable", the prop binding will be automatically one-way.

  • All props are created and observed by default when a component is instantiated.

  • When a component with replace:true is compiled, attributes on its placeholder node are now properly merged with the attributes on the component's template root node. Details:

    • If both nodes have class attributes, the class names are merged.

    • If both nodes have the same directive attribute, they will be compiled respectively in their own scope. (placeholder directives in parent scope and template root directives in child scope)

    • If both nodes have the same plain attribute, the template root node will take priority.

  • Errors in simple path getters are now suppressed by default. e.g. a.b.c when a === {}

此版本现已提供下载:https://github.com/yyx990803/vue/archive/0.12.0-beta2.zip

Vue.js 是构建 Web 界面的 JavaScript 库,提供数据驱动的组件,还有简单灵活的 API,使得 MVVM 更简单。

支持的浏览器:https://saucelabs.com/u/vuejs



历史版本 :
Vue 2.5.12 和 2.5.13 发布,轻量级 JavaScript 框架
VueJS 2.5.0 "Level E" 发布,做了许多改进
Vue 2.4.2 发布,轻量级 JavaScript 框架
Vue 2.4.0 和 2.4.1 发布,轻量级 JavaScript 框架 
Vue 2.3.4 正式发布,轻量级 JavaScript 框架 
Vue 2.3.3 正式发布,轻量级 JavaScript 框架 
Vue 2.3.2 发布,轻量级 JavaScript 框架
Vue 2.3.0 正式发布,轻量级 JavaScript 框架
Vue 2.3.0-beta.1 发布,轻量级 JavaScript 框架
Vue 2.2.6 发布,轻量级 JavaScript 框架
Vue 2.2.5 发布,轻量级 JavaScript 框架
Vue 2.2.3 和 2.2.4 发布,轻量级 JavaScript 框架
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务