Skip to content

docs: correct incorrect package name #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/advanced/cookbook/resolving-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can make use of [useRoutes](../../reference/client-api.md#useroutes) to get
The return value of `useRoutes` is a Ref object containing all routes. The keys are route paths of each route, and the values are the corresponding route information.

```ts
import { useRoutes } from 'vuepress/client'
import { useRoutes } from '@vuepress/client'

const routes = useRoutes()
// {
Expand All @@ -27,7 +27,7 @@ You can make use of [resolveRoutePath](../../reference/client-api.md#resolverout
`resolveRoutePath` receives a link and an optional base path, and returns the resolved route path:

```ts
import { resolveRoutePath } from 'vuepress/client'
import { resolveRoutePath } from '@vuepress/client'

const routePath = resolveRoutePath('/foo/') // => '/foo/'
const routePath = resolveRoutePath('baz.html', '/foo/bar.html') // => '/foo/baz.html'
Expand All @@ -40,7 +40,7 @@ You can make use of [resolveRoute](../../reference/client-api.md#resolveroute) t
`resolveRoute` receives a link and an optional base path, and returns the resolved route information:

```ts
import { resolveRoute } from 'vuepress/client'
import { resolveRoute } from '@vuepress/client'

const route = resolveRoute('/foo/') // => { notFound: false, path: '/foo/', meta: { title: 'Foo' }, loader: FooPageLoader }
const route = resolveRoute('baz.html', '/foo/bar.html') // => { notFound: false, path: '/foo/baz.html', meta: { title: 'Baz' }, loader: BazPageLoader }
Expand Down
16 changes: 8 additions & 8 deletions docs/advanced/cookbook/usage-of-client-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pluginOrTheme = {
Inside the client config file, `vuepress/client` provides a helper function [defineClientConfig](../../reference/client-api.md#defineclientconfig) to help you define the client config:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {},
Expand All @@ -40,7 +40,7 @@ The `enhance` function will be invoked after the client app is created. It's pos
You can register global Vue components via the [app.component](https://vuejs.org/api/application.html#app-component) method:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import MyComponent from './MyComponent.vue'

export default defineClientConfig({
Expand All @@ -59,7 +59,7 @@ We already provides a [ClientOnly](../../reference/components.md#clientonly) com
In the `enhance` function, you can make use of the [`__VUEPRESS_SSR__`](../../reference/client-api.md#ssr) flag for that purpose.

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
async enhance() {
Expand All @@ -76,7 +76,7 @@ export default defineClientConfig({
You can make use of the [Router Methods](https://router.vuejs.org/api/#router-methods) that provided by vue-router. For example, add navigation guard:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ router }) {
Expand Down Expand Up @@ -108,7 +108,7 @@ You can take the `setup` function as part of the [setup](https://vuejs.org/api/c
```ts
import { provide, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
setup() {
Expand All @@ -131,7 +131,7 @@ Another way to use non-ssr-friendly features is to put them inside the [onMounte

```ts
import { onMounted } from 'vue'
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
setup() {
Expand All @@ -148,7 +148,7 @@ export default defineClientConfig({
The `layouts` options is to set layout components. After layout components are registered here, users can use it via [layout](../../reference/frontmatter.md#layout) frontmatter.

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import MyLayout from './layouts/MyLayout.vue'

export default defineClientConfig({
Expand All @@ -165,7 +165,7 @@ The `rootComponents` is a components array to be placed directly into the root n
Typical usage of this option is to put some global UI components, like global popup or so:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import GlobalPopup from './components/GlobalPopup.vue'

export default defineClientConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const barTheme =
Then, create theme's client config file `client.js` :

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import Layout from './layouts/Layout.vue'
import NotFound from './layouts/NotFound.vue'

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ However, sometimes you may have some dynamical links referencing public files, e
```vue
<script setup>
import { ref } from 'vue'
import { withBase } from 'vuepress/client'
import { withBase } from '@vuepress/client'

const logoPath = ref('/images/hero.png')
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Similarly, we also have a convention for client config file paths (in order of p
A basic client config file looks like this:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {},
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Client API can be imported from `vuepress/client`.

```vue
<script setup lang="ts">
import { useClientData } from 'vuepress/client'
import { useClientData } from '@vuepress/client'

const {
pageData,
Expand Down Expand Up @@ -116,7 +116,7 @@ const {

```vue
<script setup>
import { onContentUpdated } from 'vuepress/client'
import { onContentUpdated } from '@vuepress/client'

onContentUpdated((reason) => {
console.log(`content updated reason: ${reason}`)
Expand Down Expand Up @@ -223,7 +223,7 @@ To shim the types of these constants in client side code, add `vuepress/client-t
Customizing the format of `<title>` in client config file:

```ts
import { defineClientConfig, resolvers } from 'vuepress/client'
import { defineClientConfig, resolvers } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Rendered as:
Register a layout component in `.vuepress/client.ts` file:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import CustomLayout from './CustomLayout.vue'

export default defineClientConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/plugin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default {
In client component:

```ts
import { usePageData } from 'vuepress/client'
import { usePageData } from '@vuepress/client'

export default {
setup() {
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/advanced/cookbook/resolving-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
`useRoutes` 的返回值是一个包含了所有路由信息的 Ref 对象。其属性是每条路由的路由路径,对应的值是路径的路由信息。

```ts
import { useRoutes } from 'vuepress/client'
import { useRoutes } from '@vuepress/client'

const routes = useRoutes()
// {
Expand All @@ -27,7 +27,7 @@ const routePaths = computed(() => Object.keys(routes.value))
`resolveRoutePath` 接收一个链接地址和一个可选的基础路径,返回一个解析后的路由地址:

```ts
import { resolveRoutePath } from 'vuepress/client'
import { resolveRoutePath } from '@vuepress/client'

const routePath = resolveRoutePath('/foo/') // => '/foo/'
const routePath = resolveRoutePath('baz.html', '/foo/bar.html') // => '/foo/baz.html'
Expand All @@ -40,7 +40,7 @@ const routePath = resolveRoutePath('baz.html', '/foo/bar.html') // => '/foo/baz.
`resolveRoute` 接收一个链接地址和一个可选的基础路径,返回一个解析后的路由信息:

```ts
import { resolveRoute } from 'vuepress/client'
import { resolveRoute } from '@vuepress/client'

const route = resolveRoute('/foo/') // => { notFound: false, path: '/foo/', meta: { title: 'Foo' }, loader: FooPageLoader }
const route = resolveRoute('baz.html', '/foo/bar.html') // => { notFound: false, path: '/foo/baz.html', meta: { title: 'Baz' }, loader: BazPageLoader }
Expand Down
16 changes: 8 additions & 8 deletions docs/zh/advanced/cookbook/usage-of-client-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pluginOrTheme = {
在客户端配置文件中,`vuepress/client` 提供了一个 [defineClientConfig](../../reference/client-api.md#defineclientconfig) 函数来帮助你定义客户端配置:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {},
Expand All @@ -40,7 +40,7 @@ export default defineClientConfig({
你可以通过 [app.component](https://staging-cn.vuejs.org/api/application.html#app-component) 方法来注册 Vue 全局组件:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import MyComponent from './MyComponent.vue'

export default defineClientConfig({
Expand All @@ -59,7 +59,7 @@ VuePress 会在构建过程中生成一个 SSR 应用,用以对页面进行预
在 `enhance` 函数中,你可以使用 [`__VUEPRESS_SSR__`](../../reference/client-api.md#ssr) 标记来处理这种情况。

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
async enhance() {
Expand All @@ -76,7 +76,7 @@ export default defineClientConfig({
你可以使用 vue-router 提供的 [Router 方法](https://router.vuejs.org/zh/api/index.html#router-方法) 。例如,添加导航钩子:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ router }) {
Expand Down Expand Up @@ -108,7 +108,7 @@ export default defineClientConfig({
```ts
import { provide, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
setup() {
Expand All @@ -131,7 +131,7 @@ export default defineClientConfig({

```ts
import { onMounted } from 'vue'
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
setup() {
Expand All @@ -148,7 +148,7 @@ export default defineClientConfig({
`layouts` 配置项用于设置布局组件。你在此处注册布局后,用户就可以通过 [layout](../../reference/frontmatter.md#layout) frontmatter 来使用它们。

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import MyLayout from './layouts/MyLayout.vue'

export default defineClientConfig({
Expand All @@ -165,7 +165,7 @@ export default defineClientConfig({
该选项的典型使用方式就是放置一些全局的 UI 组件,比如全局弹窗等:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import GlobalPopup from './components/GlobalPopup.vue'

export default defineClientConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/advanced/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const barTheme =
然后,创建主题的客户端配置文件 `client.js` :

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import Layout from './layouts/Layout.vue'
import NotFound from './layouts/NotFound.vue'

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guide/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
```vue
<script setup>
import { ref } from 'vue'
import { withBase } from 'vuepress/client'
import { withBase } from '@vuepress/client'

const logoPath = ref('/images/hero.png')
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineUserConfig({
一个基础的客户端配置文件是这样的:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {},
Expand Down
6 changes: 3 additions & 3 deletions docs/zh/reference/client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

```vue
<script setup lang="ts">
import { useClientData } from 'vuepress/client'
import { useClientData } from '@vuepress/client'

const {
pageData,
Expand Down Expand Up @@ -116,7 +116,7 @@ const {

```vue
<script setup>
import { onContentUpdated } from 'vuepress/client'
import { onContentUpdated } from '@vuepress/client'

onContentUpdated((reason) => {
console.log(`content updated reason: ${reason}`)
Expand Down Expand Up @@ -223,7 +223,7 @@ const {
在客户端配置文件中自定义 `<title>` 的格式:

```ts
import { defineClientConfig, resolvers } from 'vuepress/client'
import { defineClientConfig, resolvers } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/reference/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ head:
在 `.vuepress/client.ts` 文件中注册一个布局组件:

```ts
import { defineClientConfig } from 'vuepress/client'
import { defineClientConfig } from '@vuepress/client'
import CustomLayout from './CustomLayout.vue'

export default defineClientConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/reference/plugin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default {
在客户端组件中:

```ts
import { usePageData } from 'vuepress/client'
import { usePageData } from '@vuepress/client'

export default {
setup() {
Expand Down