Skip to content

Commit

Permalink
docs: correct typo ("beforeMounted" to "beforeMount") (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
fakegeek authored and ulivz committed Jun 4, 2018
1 parent 5a54efb commit e052c2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/guide/using-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ClientOnly>` component:

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guide/using-vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 不怎么友好的组件(比如包含了自定义指令),你可以将它们包裹在内置的 `<ClientOnly>` 组件中:

Expand Down

0 comments on commit e052c2a

Please sign in to comment.