Vue.js 0.12.8 發布,輕量級 JavaScript 庫

jopen 9年前發布 | 7K 次閱讀 Vue.js

Vue.js 0.12.8 發布,主要更新如下:

New

  • Strict mode: When Vue.config.strict is set to true, asset lookup will be limited to the current component only. This means a component will only inherit assets from the inheritance chain (via Vue.extend), but not from their parents in the view hierarchy. When strict mode is enabled, assets should be either registered globally, or explicitly depended on by the component that needs them. When enforced, it could result in better encapsulated components in larger projects.

Improvements

  • Source code refactored for better minification when using module bundlers. See instructions.

  • Computed properties now have their values automatically cached, and is re-evaluated lazily only when needed. This avoids expensive computations being re-run multiple times when a dependency changes.

  • v-attr now also sets the corresponding property on the element if the property exists. For example, <input value="{{val}}"> will not only update the attribute, but also set the value property. If the element doesn't have a corresponding property for the bound attribute, it will not be set.

  • v-repeat now supports item in array syntax:

    <div v-repeat="item in array"></div>
  • props declarations can now specify twoWay: true, which will throw a warning if the prop's binding type doesn't match.

  • When providing default value for a prop, you can now provide a function that returns Object/Array values to avoid having the same reference shared across multiple vms. (#1032)

  • You can now prefix any prop attribute with data- and it will just work. For example, a prop named myProp can be supplied in the template as data-my-prop. (#1034)

Fixed

  • Fixed dependency tracking when $adding properties to objects nested inside arrays.

  • #1028 v-cloak not removed correctly on conditionally compiled elements.

  • #1044 "leaveCancelled" not called properly in transitions

  • #1063 path parser accepting invalid path

  • #1065 class interpolation and v-class not working together

  • #1067 two-way binding not properly stabilized

  • #1071 & #1072 props default values not respected when data option is also present

更多內容請查看:releases

Vue.js 是構建 Web 界面的 JavaScript 庫,提供數據驅動的組件,還有簡單靈活的 API,使得 MVVM 更簡單。

支持的瀏覽器:https://saucelabs.com/u/vuejs

Vue.js 0.12.8 發布,輕量級 JavaScript 庫

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!