1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

新闻 Vue v2.0.0-alpha.5 发布,轻量级 JavaScript 框架 下载

本帖由 漂亮的石头2016-06-18 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

    注册:
    2012-02-10
    帖子:
    487,720
    赞:
    47
    Vue v2.0.0-alpha.5 发布了,Vue.js 是构建 Web 界面的 JavaScript 库,提供数据驱动的组件,还有简单灵活的 API,使得 MVVM 更简单。

    主要特性:


    • 可扩展的数据绑定


    • 将普通的 JS 对象作为 model


    • 简洁明了的 API


    • 组件化 UI 构建


    • 配合别的库使用

    新增特性及使用示例:


    • The render function now receives the component instance's $createElement method as its only argument. This avoids having to aliasing this.$createElement to something less verbose:

      Vue.extend({
      render (h) {
      return h('div', null, 'hello!')
      }
      })

    • Functional components:

      A component can be defined as a stateless functional component with functional: true.


      • createElement: the parent component's $createElement method.


      • props: an object containing props


      • children: children inside the component's tag as vnodes


      • A functional component has no instance and is simply a function that receives props and children vnodes via arguments, and also return vnode(s).


      • Unlike stateful components, functional components are not restricted by the "single root node" rule and can return an Array of multiple vnodes.


      • A functional component's render function receives the following arguments:

      Example usage:

      Vue.component('wrap-with-tag', {
      functional: true,
      props: ['tag'], render (h, props, children) {
      return h(props.tag, null, children)
      }
      })

      When used in template:

      <wrap-with-tag tag="div">hello</wrap-with-tag>

      Will render:

      <div>hello</div

    查看完整发布说明,可以点击这里

    下载地址:

    Vue v2.0.0-alpha.5 发布,轻量级 JavaScript 框架下载地址
     
正在加载...