Skip to content

Commit d21655d

Browse files
Arman19941113veaba
andauthored
docs(glossary): update "hoisting" and "cache static" (#1074)
* docs(glossary): update "hoisting" and "cache static" 同步翻译:vuejs/docs#3182 * Update src/glossary/index.md --------- Co-authored-by: Godpu <[email protected]>
1 parent 358fc65 commit d21655d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/glossary/index.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,16 @@ Vue 也支持创建自定义指令,尽管它们通常只用作操作 DOM 节
153153

154154
JavaScript 对某些结构使用了变量提升,例如 `var``import` 和函数声明。
155155

156-
在 Vue 上下文中,模板编译器应用了*静态变量提升*来提高性能。在将模板转换为渲染函数时,对应于静态内容的 VNode 可以只创建一次然后被重复使用。这些静态 VNode 是被提升的,因为它们是在渲染函数运行之前,在其外面创建的。模板编译器生成的静态对象或数组也会应用类似的变量提升。
156+
在 Vue 上下文中,模板编译器应用了*变量提升*来提高性能。在将模板转换为渲染函数时,一些静态内容会被提升到组件作用域之外。这些静态内容被描述为“被提升的”,因为它们是在组件创建之前,在其外面创建的。
157+
158+
## 缓存静态内容 (cache-static) {#cache-static}
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

0 commit comments

Comments
 (0)