Skip to content

Commit f661582

Browse files
Merge pull request vuejs#118 from dear-lizhihua/gitlocalize-222
update zh/universal.md
2 parents f727d79 + a2f1e55 commit f661582

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zh/universal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 组件生命周期钩子函数
1212

13-
由于没有动态更新,所有的生命周期钩子函数中,只有 `beforeCreate``created` 会在服务器端渲染(SSR)过程中被调用。这就是说任何其他声明周期钩子函数中的代码(例如 `beforeMount``mounted`),只会在客户端执行。
13+
由于没有动态更新,所有的生命周期钩子函数中,只有 `beforeCreate``created` 会在服务器端渲染(SSR)过程中被调用。这就是说任何其他生命周期钩子函数中的代码(例如 `beforeMount``mounted`),只会在客户端执行。
1414

1515
此外还需要注意的是,你应该避免在 `beforeCreate``created` 生命周期时产生全局副作用的代码,例如在其中使用 `setInterval` 设置 timer。在纯客户端(client-side only)的代码中,我们可以设置一个 timer,然后在 `beforeDestroy``destroyed` 生命周期时将其销毁。但是,由于在 SSR 期间并不会调用销毁钩子函数,所以 timer 将永远保留下来。为了避免这种情况,请将副作用代码移动到 `beforeMount``mounted` 生命周期中。
1616

0 commit comments

Comments
 (0)