We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f727d79 + a2f1e55 commit f661582Copy full SHA for f661582
zh/universal.md
@@ -10,7 +10,7 @@
10
11
## 组件生命周期钩子函数
12
13
-由于没有动态更新,所有的生命周期钩子函数中,只有 `beforeCreate` 和 `created` 会在服务器端渲染(SSR)过程中被调用。这就是说任何其他声明周期钩子函数中的代码(例如 `beforeMount` 或 `mounted`),只会在客户端执行。
+由于没有动态更新,所有的生命周期钩子函数中,只有 `beforeCreate` 和 `created` 会在服务器端渲染(SSR)过程中被调用。这就是说任何其他生命周期钩子函数中的代码(例如 `beforeMount` 或 `mounted`),只会在客户端执行。
14
15
此外还需要注意的是,你应该避免在 `beforeCreate` 和 `created` 生命周期时产生全局副作用的代码,例如在其中使用 `setInterval` 设置 timer。在纯客户端(client-side only)的代码中,我们可以设置一个 timer,然后在 `beforeDestroy` 或 `destroyed` 生命周期时将其销毁。但是,由于在 SSR 期间并不会调用销毁钩子函数,所以 timer 将永远保留下来。为了避免这种情况,请将副作用代码移动到 `beforeMount` 或 `mounted` 生命周期中。
16
0 commit comments