You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Fear is freedom! Subjugation is liberation! Contradiction is truth!"
"恐惧就是自由!征服就是解放!矛盾就是真理!"
新版了带来一些改进和 bug 修复,具体如下:
更新:
Full SSR + async component support in core: SSR now supports rendering async components used anywhere and the client also supports async components during the hydration phase. This means async components / code-splitting now just works during SSR and is no longer limited at the route level. (9cf6646 & 7404091)
Easier creation of wrapper components: (6118759)
New component option: inheritAttrs. Turns off the default behavior where
parent scope non-prop bindings are automatically inherited on component root
as attributes.
New instance properties: $attrs & $listeners. $attrs contains the parent-scope attribute bindings that were not recognized as props, and $listeners contains the v-on listeners registered in the parent scope (without the .native modifier). These are essentially aliases of $vnode.data.attrs and $vnode.data.on, but are reactive.
Combining these allows us to simplify a component like this down into this:
v-on: support v-on object syntax with no arguments. This pairs well with the new $listeners instance property when creating higher-order components. Note this syntax does not support modifiers. (11614d6)
Now auto-resolves ES module default export when resolving async components. This enables keeping using the simpler const Foo = () => import('./Foo.vue') syntax when declaring async components with the changes introduced in [email protected]. (0cd6ef3)
support .sync modifier for v-bind="object" (#5943) (3965e50), closes #5937
keep-alive: support Array for include and exclude (#5956) (51c595a)
weex: implement "weex.supports" api to support feature detection (#6053) (b1512d8)
vm.$watch now also supports using the same object format supported by the watch component option: { handler: () => {}, deep: true } (#5645) (5aac170)
types: add types for vue-server-renderer (#5775) (e6de9a5)
Vue.config.errorHandler now also captures errors thrown in custom event handlers (#5709) (11b7d5d)
add new config option Vue.config.warnHandler for defining a custom callback for runtime warnings. This only works in the development build. (#5883) (9881b40)
add comments option to allow preserving comments in template (#5951) (e4da249), closes #5392
性能改进:
ssr: vue-template-compiler now has two new SSR-specific compile methods that generates SSR-specific render function code by optimizing parts of the template into string concatenation. This improves raw SSR render performance by 2~8x depending on how much of the template can be optimized. Note this will have a much smaller impact on requests per second for a real app because raw render performance is only a small portion of the overall time spent in a request.
This is enabled by default in vue-loader@>=12 and can be disabled using the optimizeSSR option.
remove src directory from npm module, which should reduce download size when installing from npm. (#6072) (e761573)
Vue 2.4.0 正式发布了,Vue 是一款轻量级 JavaScript MVVM框架。
"Fear is freedom! Subjugation is liberation! Contradiction is truth!"
"恐惧就是自由!征服就是解放!矛盾就是真理!"
新版了带来一些改进和 bug 修复,具体如下:
更新:
Full SSR + async component support in core: SSR now supports rendering async components used anywhere and the client also supports async components during the hydration phase. This means async components / code-splitting now just works during SSR and is no longer limited at the route level. (9cf6646 & 7404091)
Easier creation of wrapper components: (6118759)
parent scope non-prop bindings are automatically inherited on component root
as attributes.
v-on: support v-on object syntax with no arguments. This pairs well with the new $listeners instance property when creating higher-order components. Note this syntax does not support modifiers. (11614d6)
Now auto-resolves ES module default export when resolving async components. This enables keeping using the simpler const Foo = () => import('./Foo.vue') syntax when declaring async components with the changes introduced in [email protected]. (0cd6ef3)
support .sync modifier for v-bind="object" (#5943) (3965e50), closes #5937
keep-alive: support Array for include and exclude (#5956) (51c595a)
weex: implement "weex.supports" api to support feature detection (#6053) (b1512d8)
vm.$watch now also supports using the same object format supported by the watch component option: { handler: () => {}, deep: true } (#5645) (5aac170)
types: add types for vue-server-renderer (#5775) (e6de9a5)
Vue.config.errorHandler now also captures errors thrown in custom event handlers (#5709) (11b7d5d)
add new config option Vue.config.warnHandler for defining a custom callback for runtime warnings. This only works in the development build. (#5883) (9881b40)
add comments option to allow preserving comments in template (#5951) (e4da249), closes #5392
性能改进:
官方为 Vue 创建了一个全新的服务器端渲染指南,建议所有使用者阅读。此外,还更新了 HackerNews 的 Demo,以反映最新的最佳做法。
Bug 修复:
更新内容较多,详情请参阅发布说明:https://github.com/vuejs/vue/releases/tag/v2.4.0
The text was updated successfully, but these errors were encountered: