From eaaa25cf3939dc0c2981882a824f945238d5f031 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Tue, 16 Oct 2018 01:52:14 +0800 Subject: [PATCH] docs: add global-computed --- .../docs/miscellaneous/global-computed.md | 83 ++++++++++++++++++ .../docs/zh/miscellaneous/global-computed.md | 85 +++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 packages/docs/docs/miscellaneous/global-computed.md create mode 100644 packages/docs/docs/zh/miscellaneous/global-computed.md diff --git a/packages/docs/docs/miscellaneous/global-computed.md b/packages/docs/docs/miscellaneous/global-computed.md new file mode 100644 index 0000000000..0ffff38ace --- /dev/null +++ b/packages/docs/docs/miscellaneous/global-computed.md @@ -0,0 +1,83 @@ +--- +sidebar: auto +--- + +# Global Computed + +In VuePress, some core [computed](https://vuejs.org/v2/guide/computed.html#Computed-Properties) properties are built in for use by [default theme](../theme/default-theme-config.md) or custom themes. + +## $site + +This is the `$site` value of the website you see now: + +``` json +{ + "title": "VuePress", + "description": "Vue 驱动的静态网站生成器", + "base": "/", + "pages": [ + { + "lastUpdated": 1524027677000, + "path": "/", + "title": "VuePress", + "frontmatter": {} + }, + ... + ] +} +``` + +## $page + +This is the `$page` value of the page you see now: + +``` json +{ + "title": "Global Computed", + "frontmatter": {}, + "regularPath": "/miscellaneous/global-computed.html", + "key": "v-d4cbeb69eff3d", + "path": "/miscellaneous/global-computed.html", + "headers": [ + { + "level": 2, + "title": "$site", + "slug": "site" + }, + { + "level": 2, + "title": "$page", + "slug": "$page" + }, + ... + ] +} +``` + +## $lang + +The language of the current page. default value is `en-US`. + +**Also see:** + +- [Internationalization](../guide/i18n.md) + +## $localePath + +The locale path prefix for the current page, the default value is `/`. + +**Also see:** + +- [Internationalization](../guide/i18n.md) + +## $title + +Value of the `