From b2605fa0a18e07cd3850853da792022081a4167d Mon Sep 17 00:00:00 2001 From: Eddie Chen Date: Sun, 3 Jun 2018 18:12:01 -0700 Subject: [PATCH] fix: typo: hookname 'beforeMounted' should be 'beforeMount' in docs. --- docs/guide/using-vue.md | 2 +- docs/zh/guide/using-vue.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/using-vue.md b/docs/guide/using-vue.md index b827f6cd0f..219f574185 100644 --- a/docs/guide/using-vue.md +++ b/docs/guide/using-vue.md @@ -2,7 +2,7 @@ ## Browser API Access Restrictions -Because VuePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://ssr.vuejs.org/en/universal.html). In short, make sure to only access Browser / DOM APIs in `beforeMounted` or `mounted` hooks. +Because VuePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://ssr.vuejs.org/en/universal.html). In short, make sure to only access Browser / DOM APIs in `beforeMount` or `mounted` hooks. If you are using or demoing components that are not SSR friendly (for example containing custom directives), you can wrap them inside the built-in `` component: diff --git a/docs/zh/guide/using-vue.md b/docs/zh/guide/using-vue.md index 8e72f01812..6ffcc1e889 100644 --- a/docs/zh/guide/using-vue.md +++ b/docs/zh/guide/using-vue.md @@ -2,7 +2,7 @@ ## 浏览器的 API 访问限制 -当你在开发一个 VuePress 应用时,由于所有的页面在生成静态 HTML 时都需要通过 Node.js 服务端渲染,因此所有的 Vue 相关代码都应当遵循 [编写通用代码](https://ssr.vuejs.org/zh/universal.html) 的要求。简而言之,请确保只在 `beforeMounted` 或者 `mounted` 访问浏览器 / DOM 的 API。 +当你在开发一个 VuePress 应用时,由于所有的页面在生成静态 HTML 时都需要通过 Node.js 服务端渲染,因此所有的 Vue 相关代码都应当遵循 [编写通用代码](https://ssr.vuejs.org/zh/universal.html) 的要求。简而言之,请确保只在 `beforeMount` 或者 `mounted` 访问浏览器 / DOM 的 API。 如果你正在使用,或者需要展示一个对于 SSR 不怎么友好的组件(比如包含了自定义指令),你可以将它们包裹在内置的 `` 组件中: