Skip to content

Commit

Permalink
docs: revert meta to routeMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Feb 2, 2024
1 parent d2696f7 commit 67a46e5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions docs/reference/frontmatter.md
Expand Up @@ -189,16 +189,16 @@ Then the permalink of the page would be `2021/01/03/bar-baz.html`.
- [Frontmatter > permalink](#permalink)
- [Node API > Page Properties > permalink](./node-api.md#permalink)

## meta
## routeMeta

- Type: `Record<string, unknown>`

- Details:

Custom data to be attached to the page.
Custom data to be attached to the page route.

- Also see:
- [Node API > Page Properties > meta](./node-api.md#meta)
- [Node API > Page Properties > routeMeta](./node-api.md#routeMeta)

## title

Expand Down
10 changes: 5 additions & 5 deletions docs/reference/node-api.md
Expand Up @@ -601,7 +601,7 @@ interface MarkdownLink {
- [Frontmatter > permalink](./frontmatter.md#permalink)
- [Frontmatter > permalinkPattern](./frontmatter.md#permalinkpattern)

### meta
### routeMeta

- Type: `Record<string, unknown>`

Expand All @@ -610,12 +610,12 @@ interface MarkdownLink {
Custom data to be attached to the page route.

- Also see:
- [Frontmatter > meta](./frontmatter.md#meta)
- [Frontmatter > routeMeta](./frontmatter.md#routemeta)

::: tip What's the difference between page meta and page data?
Both [page meta](#meta) and [page data](#data) is available in client side. However, route meta is attached to the page routes records, so the page meta of all pages would be loaded at once when users enter your site. In the contrast, page data is saved in separated files, which would be loaded only when users enter the corresponding page.
::: tip What's the difference between route meta and page data?
Both [route meta](#routemeta) and [page data](#data) is available in client side. However, route meta is attached to the page route record, so the route meta of all pages would be loaded at once when users enter your site. In the contrast, page data is saved in separated files, which would be loaded only when users enter the corresponding page.

Therefore, it's not recommended to store large amounts of info into page meta, otherwise the initial loading speed will be affected a lot when your site has a large number of pages.
Therefore, it's not recommended to store large amounts of info into route meta, otherwise the initial loading speed will be affected a lot when your site has a large number of pages.
:::

### sfcBlocks
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/plugin-api.md
Expand Up @@ -295,7 +295,7 @@ export default {

This hook can be used for adding extra properties or modifying current properties on `Page` object.

Notice that changes to `page.data` and `page.meta` can be used in client side code.
Notice that changes to `page.data` and `page.routeMeta` can be used in client side code.

- Example:

Expand Down Expand Up @@ -324,7 +324,7 @@ export default {
- Also see:
- [Client API > usePageData](./client-api.md#usepagedata)
- [Node API > Page Properties > data](./node-api.md#data)
- [Node API > Page Properties > meta](./node-api.md#meta)
- [Node API > Page Properties > routeMeta](./node-api.md#routemeta)

## Lifecycle Hooks

Expand Down
4 changes: 2 additions & 2 deletions docs/zh/reference/frontmatter.md
Expand Up @@ -189,7 +189,7 @@ permalinkPattern: :year/:month/:day/:slug.html
- [Frontmatter > permalink](#permalink)
- [Node API > Page 属性 > permalink](./node-api.md#permalink)

## meta
## routeMeta

- 类型: `Record<string, unknown>`

Expand All @@ -198,7 +198,7 @@ permalinkPattern: :year/:month/:day/:slug.html
附加到页面路由的自定义数据。

- 参考:
- [Node API > Page 属性 > meta](./node-api.md#meta)
- [Node API > Page 属性 > routeMeta](./node-api.md#routeMeta)

## title

Expand Down
12 changes: 6 additions & 6 deletions docs/zh/reference/node-api.md
Expand Up @@ -599,21 +599,21 @@ interface MarkdownLink {
- [Frontmatter > permalink](./frontmatter.md#permalink)
- [Frontmatter > permalinkPattern](./frontmatter.md#permalinkpattern)

### meta
### routeMeta

- 类型: `Record<string, unknown>`

- 详情:

附加到 vue-router 路由记录上的额外数据
附加到页面路由记录上的额外数据

- 参考:
- [Frontmatter > meta](./frontmatter.md#meta)
- [Frontmatter > routeMeta](./frontmatter.md#routemeta)

::: tip Page Meta 和 Page Data 的区别是什么?
[Page Meta](#meta)[Page Data](#data) 都可以在客户端代码中使用。然而, Page Meta 是附加在页面路由记录上的,因此当用户进入你的站点时,所有页面的 Page Meta 都会立即被加载。相比之下, Page Data 是存储在单独的文件中的,只有在用户进入对应页面时才会被加载。
::: tip Route Meta 和 Page Data 的区别是什么?
[Route Meta](#routemeta)[Page Data](#data) 都可以在客户端代码中使用。然而, Route Meta 是附加在页面路由记录上的,因此当用户进入你的站点时,所有页面的 Route Meta 都会立即被加载。相比之下, Page Data 是存储在单独的文件中的,只有在用户进入对应页面时才会被加载。

因此,不建议在 Page Meta 中存储大量的信息,否则在站点有很多页面时,将会影响站点的初始加载速度。
因此,不建议在 Route Meta 中存储大量的信息,否则在站点有很多页面时,将会影响站点的初始加载速度。
:::

### sfcBlocks
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/reference/plugin-api.md
Expand Up @@ -295,7 +295,7 @@ export default {

该 Hook 可以用来在 Page 对象上添加额外的属性,或修改现有的属性等。

值得一提的是,针对 `page.data``page.meta` 的改动可以在客户端代码中使用。
值得一提的是,针对 `page.data``page.routeMeta` 的改动可以在客户端代码中使用。

- 示例:

Expand Down Expand Up @@ -324,7 +324,7 @@ export default {
- 参考:
- [客户端 API > usePageData](./client-api.md#usepagedata)
- [Node API > Page 属性 > data](./node-api.md#data)
- [Node API > Page 属性 > meta](./node-api.md#meta)
- [Node API > Page 属性 > routeMeta](./node-api.md#routemeta)

## 生命周期 Hooks

Expand Down

0 comments on commit 67a46e5

Please sign in to comment.