File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,16 @@ Vue 也支持创建自定义指令,尽管它们通常只用作操作 DOM 节
153153
154154JavaScript 对某些结构使用了变量提升,例如 ` var ` 、` import ` 和函数声明。
155155
156- 在 Vue 上下文中,模板编译器应用了* 静态变量提升* 来提高性能。在将模板转换为渲染函数时,对应于静态内容的 VNode 可以只创建一次然后被重复使用。这些静态 VNode 是被提升的,因为它们是在渲染函数运行之前,在其外面创建的。模板编译器生成的静态对象或数组也会应用类似的变量提升。
156+ 在 Vue 上下文中,模板编译器应用了* 变量提升* 来提高性能。在将模板转换为渲染函数时,一些静态内容会被提升到组件作用域之外。这些静态内容被描述为“被提升的”,因为它们是在组件创建之前,在其外面创建的。
157+
158+ ## 缓存静态内容
159+
160+ * 缓存* 用于描述对经常访问的数据进行临时存储,以提高性能。
161+
162+ Vue 的模板编译器会识别静态 VNodes,在首次渲染时会将其缓存起来,并在后续的重新渲染中使用缓存的 VNodes。
157163
158164详见:
159- - [ 指南 - 渲染机制 - 静态提升 ] ( /guide/extras/rendering-mechanism.html#static-hoisting )
165+ - [ 指南 - 渲染机制 - 缓存静态内容 ] ( /guide/extras/rendering-mechanism.html#cache-static )
160166
161167## DOM 内模板 (in-DOM template) {#in-dom-template}
162168
You can’t perform that action at this time.
0 commit comments