├── .gitignore ├── docs ├── public │ ├── icon.png │ └── logo.svg ├── .vitepress │ ├── theme │ │ ├── index.js │ │ └── styles │ │ │ └── index.css │ └── config.js ├── directory-structure │ ├── gitignore.md │ ├── tsconfig.md │ ├── composables.md │ ├── app-vue.md │ ├── server.md │ ├── layouts.md │ ├── plugins.md │ ├── pages.md │ ├── components.md │ └── nuxt-config.md ├── deployment │ ├── vercel.md │ ├── Netlify.md │ ├── pm2.md │ └── azure.md ├── getting-started │ └── installation.md ├── index.md └── usage │ ├── meta.md │ ├── nuxt-app.md │ ├── state.md │ ├── runtime-config.md │ ├── cookies.md │ └── data-fetching.md ├── package.json ├── .github └── workflows │ ├── docs-pr-check.yml │ └── deploy-docs.yml ├── README.md └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /docs/.vitepress/dist/ 3 | .vscode 4 | .idea 5 | .DS_Store -------------------------------------------------------------------------------- /docs/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/57code/nuxt3-docs-zh/HEAD/docs/public/icon.png -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import theme from 'vitepress/dist/client/theme-default' 2 | import './styles/index.css' 3 | 4 | export default { 5 | ...theme, 6 | } 7 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/styles/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --c-brand: #00C675; 3 | --c-brand-light: #429988; 4 | } 5 | 6 | .nav-bar .logo { 7 | height: 30px; 8 | margin-right: 2px; 9 | } -------------------------------------------------------------------------------- /docs/directory-structure/gitignore.md: -------------------------------------------------------------------------------- 1 | # `.gitignore` 文件 [Gitignore file](https://v3.nuxtjs.org/docs/directory-structure/gitignore) 2 | 3 | 通过 `.gitignore` 文件指定 git 应该忽略的故意取消跟踪的文件。在 [git 文档](https://git-scm.com/docs/gitignore) 中了解更多信息。 4 | 5 | 我们建议使用一个 `.gitignore` 文件,该文件**至少**包含以下条目: 6 | 7 | ```bash 8 | # Nuxt dev/build 输出 9 | .output 10 | .nuxt 11 | # Node 依赖 12 | node_modules 13 | # 系统文件 14 | *.log 15 | ``` 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt3-docs-zh", 3 | "version": "0.0.1", 4 | "description": "nuxt3中文文档", 5 | "main": "index.js", 6 | "repository": "http://github.com/57code/nuxt3-docs-zh", 7 | "author": "57code", 8 | "license": "MIT", 9 | "scripts": { 10 | "docs:dev": "vitepress dev docs", 11 | "docs:build": "vitepress build docs", 12 | "docs:serve": "vitepress serve docs" 13 | }, 14 | "devDependencies": { 15 | "vitepress": "^0.20.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /docs/directory-structure/tsconfig.md: -------------------------------------------------------------------------------- 1 | # TS 配置文件 [TypeScript configuration file](https://v3.nuxtjs.org/docs/directory-structure/tsconfig) 2 | 3 | Nuxt [自动生成](https://v3.nuxtjs.org/concepts/typescript) 一个 `.nuxt/tsconfig.json` 文件,其中包含您在 Nuxt 项目中使用的解析别名,以及其他合理的默认值。 您可以通过在项目的根目录中创建一个包含以下内容的 `tsconfig.json` 来从中受益: 4 | 5 | ```json 6 | { 7 | "extends": "./.nuxt/tsconfig.json" 8 | } 9 | ``` 10 | 11 | 如果需要,您可以自定义此文件的内容。但请注意,如果您需要自定义 `paths` ,将会完全覆盖自动生成的路径别名。实际上我们建议您在 `nuxt.config` 中的 `alias` 属性中添加您所需要的全部路径别名,它们将被提取并添加到自动生成的 `tsconfig` 中。 12 | -------------------------------------------------------------------------------- /docs/deployment/vercel.md: -------------------------------------------------------------------------------- 1 | # Vercel 2 | 3 | 如何将 Nuxt 部署到 Vercel 服务。 4 | 5 | 6 | - 支持无服务器构建 7 | - 部署时自动检测 8 | - 无需配置 9 | 10 | ## 设置 11 | 12 | 默认情况下,[`Vercel`](https://vercel.com) 会运行 `package.json` 中的 `build` 命令并且自动检测 `.vercel_build_output/` 内构建的入口。 13 | 14 | ## 部署 15 | 16 | [`和平常使用Vercel时一样`](https://vercel.com/docs/git),只需将其推送到 git 存储库中。 17 | 18 | 19 | ## 更多 20 | 21 | 详见[`更多设置信息`](https://v3.nuxtjs.org/docs/deployment/presets/node/)。 22 | 23 | ## 例子 24 | 25 | [`https://nitro-demo.vercel.app/`](https://nitro-demo.vercel.app/) 提供了在线演示。 26 | -------------------------------------------------------------------------------- /docs/public/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/deployment/Netlify.md: -------------------------------------------------------------------------------- 1 | # Netlify 2 | 3 | 如何将 Nuxt 部署到 Netlify 服务。 4 | 5 | 6 | 7 | - 支持无服务器的SSR构建 8 | - 部署时自动检测 9 | - 无需配置 10 | 11 | ## 设置 12 | 13 | Nitro 会自动检测到你的 Netlify 环境,并构建正确版本的Nuxt服务。对于新站点,Netlify 会检测到你正在使用 Nuxt 3 或 bridge,将发布目录设置为 `dist` ,然后使用 `npm run build` 命令。如果您正在升级一个现有的站点,您应该检查这些并在需要时更新它们。 14 | 15 | ## 部署 16 | 17 | [`和平常使用Netlify时一样`](https://docs.netlify.com/configure-builds/get-started/),推送到你的 git 仓库。 18 | ( Netlify 允许链接 GitHub 、GitLab 或者 Bitbucket 仓库作为一个站点以便持续集成部署 ) 19 | 20 | ## 更多 21 | 22 | 有关[`Lambda预设`](https://v3.nuxtjs.org/docs/deployment/presets/lambda)的详细信息,请参阅更多信息。 23 | 24 | ## 例子 25 | 26 | 可以在[`https://nitro-demo.netlify.app/`](https://nitro-demo.netlify.app/) 地址查看。 -------------------------------------------------------------------------------- /.github/workflows/docs-pr-check.yml: -------------------------------------------------------------------------------- 1 | # GitAction 名称 2 | name: docs PR check 3 | 4 | # 此CI/CD触发时的事件 push:在代码提交时自动触发 5 | on: 6 | pull_request: 7 | branches: 8 | - master 9 | 10 | # 一个 CI/CD 的工作流有许多 jobs 组成,比如最典型的 job 是 lint,test,build等,这里起名 build-and-deploy 11 | jobs: 12 | check-pr-build: 13 | runs-on: ubuntu-latest # 运行workflow的服务器系统:ubuntu最新版本 14 | 15 | steps: 16 | - name: checkout 🔐 17 | uses: actions/checkout@v2 18 | 19 | - name: Set node version to 16 🛠️ 20 | uses: actions/setup-node@v2 21 | with: 22 | node-version: 16 23 | cache: "yarn" 24 | 25 | - name: Install deps 📦 26 | run: yarn install 27 | 28 | - name: Build 🛠️ 29 | run: yarn run docs:build 30 | -------------------------------------------------------------------------------- /docs/getting-started/installation.md: -------------------------------------------------------------------------------- 1 | # 安装 [Installation](https://v3.nuxtjs.org/getting-started/installation) 2 | 3 | Nuxt3 十分简单易用。 4 | 5 | ::: warning 提示 6 | 迁移现有Nuxt 2项目,请跳过此步骤并按照升级指南 [Bridge instructions](https://v3.nuxtjs.org/getting-started/bridge)。在[Introduction](https://v3.nuxtjs.org/getting-started/bridge)中了解更多新特性。 7 | ::: 8 | 9 | ### 创建项目 10 | 11 | 打开 Visual Studio Code , 打开内置终端并输入下面命令创建一个nuxt项目: 12 | 13 | ``` bash 14 | npx nuxi init nuxt3-app 15 | ``` 16 | 17 | ::: warning 提示 18 | 踩坑指南:node版本需要高于v14.16.0 19 | ::: 20 | 21 | ### 安装依赖 22 | 23 | ``` bash 24 | yarn install 25 | ``` 26 | 27 | ### 启动 28 | 29 | 使用 `yarn dev` 以 开发模式启动nuxt: 30 | 31 | ``` bash 32 | yarn dev 33 | ``` 34 | 35 | ### 下一步 36 | 37 | 创建完成Nuxt 3项目,下一步就可以开始构建应用程序了。 38 | 39 | - 了解概念 [Concepts](https://v3.nuxtjs.org/concepts/introduction) 40 | - 了解使用方法 [Usage](https://v3.nuxtjs.org/docs/usage/data-fetching) 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yml: -------------------------------------------------------------------------------- 1 | # GitAction 名称 2 | name: Build Docs and Deploy 3 | 4 | # 此CI/CD触发时的事件 push:在代码提交时自动触发 5 | on: 6 | push: 7 | branches: 8 | - master 9 | 10 | # 一个 CI/CD 的工作流有许多 jobs 组成,比如最典型的 job 是 lint,test,build等,这里起名 build-and-deploy 11 | jobs: 12 | build-and-deploy: 13 | runs-on: ubuntu-latest # 运行workflow的服务器系统:ubuntu最新版本 14 | 15 | steps: 16 | - name: Checkout 🛎️ 17 | uses: actions/checkout@v2 18 | 19 | - name: Set node version to 16 🛠️ 20 | uses: actions/setup-node@v2 21 | with: 22 | node-version: 16 23 | cache: "yarn" 24 | 25 | - name: Install deps 📦 26 | run: yarn install 27 | 28 | - name: Build 🛠️ 29 | run: yarn run docs:build 30 | 31 | - name: Deploy 🚀 32 | uses: JamesIves/github-pages-deploy-action@4.1.6 33 | with: 34 | BRANCH: gh-pages 35 | FOLDER: docs/.vitepress/dist 36 | -------------------------------------------------------------------------------- /docs/directory-structure/composables.md: -------------------------------------------------------------------------------- 1 | # 可复用组合逻辑 [composables](https://v3.nuxtjs.org/docs/directory-structure/composables) 2 | 3 | ::: tip 说明: 4 | 在 Nuxt3 的约定下,用户在`composables`目录下创建的组合逻辑文件将会被系统自动识别导入到应用程序,以供全局使用。 5 | ::: 6 | 7 | ## 案例 8 | 9 | ::: tip 操作: 10 | 在 composables 文件夹下新建`useFoo.ts`文件,编写组合逻辑代码。 11 | ::: 12 | 13 | ### 命名导出 14 | 15 | ```ts 16 | import { useState } from '#app'; 17 | 18 | export const useFoo = () => { 19 | return useState('foo', () => 'bar'); 20 | }; 21 | ``` 22 | 23 | ### 默认导出 24 | 25 | ```ts 26 | import { useState } from '#app'; 27 | 28 | //使用: useFoo() 29 | export default function () { 30 | return useState('foo', () => 'bar'); 31 | } 32 | ``` 33 | 34 | ::: danger 注意: 35 | 默认导出以文件名的方式来进行默认导出使用,文件名必须遵循 `pascalCase`、`camelCase` 规范。 36 | ::: 37 | 38 | ### 使用 39 | 40 | 编写好组合逻辑文件后,Nuxt3 就会自动的导入,您可以在应用程序中使用它而无需手动导入。 41 | 42 | ```vue 43 | 48 | 49 | 52 | ``` 53 | -------------------------------------------------------------------------------- /docs/deployment/pm2.md: -------------------------------------------------------------------------------- 1 | # PM2 2 | 3 | 如何使用 PM2 将 Nuxt 部署到 Node.js 服务上。 4 | 5 | 6 | 7 | - 支持极少的 SSR 构建 8 | - 零毫秒冷启动 9 | - 可进行更多的配置 10 | 11 | ## 设置 12 | 13 | 确保没有在其它地方配置 `nuxt.config` 文件。 14 | 15 | ```js [nuxt.config.js|ts] 16 | export default { 17 | nitro: { 18 | // 这是一个默认的配置,你也可以忽略它 19 | // preset: 'server' 20 | } 21 | } 22 | ``` 23 | 24 | ## 部署 25 | 26 | 运行 `yarn build`, 打包后的所有文件都在 `.output` 文件夹中。 静态资源在 `public` 子目录中, 服务及其依赖在 `server` 子目录中。 27 | 28 | 这个 `.output` 文件夹可以部署到你的 Node.js 服务上 ,服务器可以用 [`pm2`](https://pm2.keymetrics.io/docs/)。 29 | 30 | 要以生产模式启动服务,请运行: 31 | 32 | ```bash 33 | node .output/server/index.mjs 34 | ``` 35 | 36 | 使用 `pm2` 的配置: 37 | 38 | ```js [ecosystem.config.js] 39 | module.exports = { 40 | apps: [ 41 | { 42 | name: 'NuxtAppName', 43 | exec_mode: 'cluster', 44 | instances: 'max', 45 | script: './.output/server/index.mjs' 46 | } 47 | ] 48 | } 49 | ``` 50 | 51 | ## 更多 52 | 53 | 查看有关 [`服务器配置`](https://v3.nuxtjs.org/docs/deployment/presets/server)的更多信息。 -------------------------------------------------------------------------------- /docs/directory-structure/app-vue.md: -------------------------------------------------------------------------------- 1 | # 入口组件 [App](https://v3.nuxtjs.org/docs/directory-structure/app) 2 | 3 | `app.vue` 文件是Nuxt 3应用程序中的入口组件。 4 | 5 | ## 最小应用 6 | 7 | 在Nuxt 3中如果没有[`pages/`](https://v3.nuxtjs.org/docs/directory-structure/pages)目录,则表示不会包含[vue-router](https://next.router.vuejs.org/)依赖。 当我们完成一个落地页或者是不需要路由就可以这样做。 8 | 9 | ```vue [app.vue] 10 | 13 | ``` 14 | 15 | ## pages 16 | 17 | 18 | 如果需要使用[`pages/`](https://v3.nuxtjs.org/docs/directory-structure/pages)显示相关页面的话,需要使用 `` 路由出口组件: 19 | 20 | ```vue [app.vue] 21 | 27 | ``` 28 | 29 | ::: info 建议 30 | 由于Nuxt 3 的路由出口`` 在内部使用了 [``](https://v3.vuejs.org/guide/migration/suspense.html) ,因此建议只有一个根节点。 31 | ::: 32 | 33 | ::: warning 提示 34 | `app.vue`是Nuxt应用程序的入口组件。您在其中添加的任何内容(JS和CSS)都是全局的,会影响到其他页面。 35 | ::: 36 | 37 | 如果需要自定义页面布局的话,请查看[`layouts/`](https://v3.nuxtjs.org/docs/directory-structure/layouts)目录. 38 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | heroImage: /logo.svg 4 | actionText: 快速上手 5 | actionLink: /getting-started/installation 6 | 7 | features: 8 | - title: 更轻量 9 | details: 以现代浏览器为目标的情况下,服务器部署和客户端产物最多可达75倍的减小。 10 | - title: 更快 11 | details: 用动态服务端代码分割来优化冷启动,由 nitro 提供能力。 12 | - title: Hybrid 13 | details: 增量静态生成和其他高级模式现在都成为可能。 14 | - title: Suspense 15 | details: 导航前后皆任何组件中获取数据。 16 | - title: Composition API 17 | details: 使用 Composition API 和 Nuxt 3 的 composables 实现真正的可复用性。 18 | - title: Nuxt CLI 19 | details: 全新的零依赖体验,助您轻松搭建项目和集成模块。 20 | - title: Nuxt Devtools 21 | details: 更多的信息和快速修复,在浏览器中高效工作。 22 | - title: Nuxt Kit 23 | details: 全新的基于 TypeScript 和跨版本兼容的模块开发。 24 | - title: Webpack 5 25 | details: 更快的构建速度和更小的构建产物,并且零配置。 26 | - title: Vite 27 | details: 用 Vite 作为你的打包器,体验轻量级的快速 HMR。 28 | - title: Vue3 29 | details: Vue3 会成为您下一个应用的坚实基础。 30 | - title: TypeScript 31 | details: 由原生 TypeScript 和 ESM 构成 —— 没有额外的步骤。 32 | footer: MIT Licensed | Copyright © 2021-present 33 | --- -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt3中文文档 2 | - [Github Page](https://57code.github.io/nuxt3-docs-zh/) 3 | - [Gitee Page](https://57code.gitee.io/nuxt3-docs-zh/) 4 | - [Nuxt3中文网](http://nuxt3.cn),建设中... 5 | 6 | ## 项目背景 7 | [Nuxt3官网](http://v3.nuxtjs.org/docs/usage/data-fetching/)现在太难用了: 8 | - 英文 9 | - 没有学习路径 10 | - 速度慢 11 | 12 | 我第一时间想到做一个[视频教程](https://space.bilibili.com/480140591/channel/collectiondetail?sid=34039),翻译一版文档,设计一个学习路径,建设一个Nuxt3中文网帮助大家学习!如果有帮到您,请给本项目点个star! 13 | ## 关注我 14 | 我是村长,是一名程序员、UP主、讲师,欢迎关注我: 15 | - 公众号「村长学前端」 16 | - B站「[Young村长](https://space.bilibili.com/480140591)」 17 | 18 | ## 快速开始 19 | 第一步:clone 源代码 20 | ```bash 21 | git clone https://github.com/57code/nuxt3-docs-zh.git 22 | ``` 23 | 24 | 第二步:安装依赖 25 | ```bash 26 | yarn 27 | ``` 28 | 29 | 第三步:本地启动 30 | ```bash 31 | yarn docs:dev 32 | ``` 33 | 34 | ## Nuxt3视频教程 35 | [Nuxt3从入门到实战](https://space.bilibili.com/480140591/channel/collectiondetail?sid=34039) 36 | ,欢迎小伙们快乐学习的同时动动小手,三连+关注+分享! 37 | 38 | 39 | ## 致谢 40 | 本次翻译活动有很多村长的朋友们加入,感谢你们的付出: 41 | [迷心whylost](https://github.com/whylost) 42 | [拜托啦俊酱丶](https://github.com/jerry-lllman) 43 | [williamhatch](https://github.com/williamhatch) 44 | -------------------------------------------------------------------------------- /docs/usage/meta.md: -------------------------------------------------------------------------------- 1 | # 元标签 2 | 3 | 4 | 5 | 您可以通过几种不同的方式为您的网站自定义元标签: 6 | 7 | 8 | 9 | ## 组合式api useMeta 10 | 11 | 在您的`setup`函数中,您可以`useMeta`使用元属性的对象调用与元标记对应的键:`title`, `base`, `script`, `style`, `meta`and `link`, 以及`htmlAttrs`和 `bodyAttrs`。或者,您可以传递一个返回响应式元数据对象的函数。 12 | 13 | 例如: 14 | 15 | ```vue 16 | export default { 17 | setup () { 18 | useMeta({ 19 | meta: [ 20 | { name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1' } 21 | ], 22 | bodyAttrs: { 23 | class: 'test' 24 | } 25 | }) 26 | } 27 | } 28 | ``` 29 | 30 | 31 | 32 | ## 元组件 33 | 34 | Nuxt提供``,`<Base>`,`<Script>`,`<Style>`,`<Meta>`,`<Link>`,`<Body>`,`<Html>`和`<Head>`组件,以便您可以直接与您的组件的模板中的元数据进行交互。 35 | 36 | 由于这些组件名称与原生 HTML 元素匹配,因此在 **模板中将它们大写非常重要**。 37 | 38 | `<Head>`和`<Body>`可以接受嵌套元标记(出于审美原因),但这对嵌套元标记在最终 HTML 中的呈现*位置*没有影响。 39 | 40 | 例如: 41 | 42 | ```vue 43 | <template> 44 | <div> 45 | Hello World 46 | <Html :lang="dynamic > 50 ? 'en-GB' : 'en-US'"> 47 | <Head> 48 | <Title>{{ dynamic }} title 49 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 65 | ``` 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /docs/directory-structure/server.md: -------------------------------------------------------------------------------- 1 | # 服务器目录(server) 2 | 3 | 服务器目录用于为 Nuxt 应用程序创建任何后端逻辑。它支持 HMR 和强大的功能。 4 | 5 | `server/`该目录包含项目的 API 端点和服务器中间件。 6 | 7 | ## 接口路由 8 | 9 | Nuxt 将自动读取`~/server/api`目录中的任何文件,以创建 API 端点。 10 | 11 | 每个文件都应导出一个处理 API 请求的默认函数。它可以直接返回承诺或 JSON 数据(或使用 )。`res.end()` 12 | 13 | ### 例子 14 | 15 | #### Hello world 16 | 17 | > *server/api/hello.ts* 18 | 19 | ```ts 20 | export default (req, res) => 'Hello World' 21 | ``` 22 | 23 | http://localhost:3000/api/hello[上查看](http://localhost:3000/api/hello)结果。 24 | 25 | #### 异步函数 26 | 27 | > *server/api/async.ts* 28 | 29 | ```ts 30 | export default async (req, res) => { 31 | await someAsyncFunction() 32 | 33 | return { 34 | someData: true 35 | } 36 | } 37 | ``` 38 | 39 | **示例:**使用 Node.js 样式 40 | 41 | > *server/api/node.ts* 42 | 43 | ```ts 44 | import type { IncomingMessage, ServerResponse } from 'http' 45 | 46 | export default async (req: IncomingMessage, res: ServerResponse) => { 47 | res.statusCode = 200 48 | res.end('Works!') 49 | } 50 | ``` 51 | 52 | ## 服务器中间件 53 | 54 | Nuxt 将自动读取`~/server/middleware` 中的任何文件,以便为您的项目创建服务器中间件。 55 | 56 | 这些文件将在每个请求上运行,这与映射到其自己路由的[API routes](https://v3.nuxtjs.org/docs/directory-structure/api)不同。这通常是为了让您能够向所有响应添加公共标头、记录响应或修改传入请求对象以供以后在请求链中使用。 57 | 58 | 每个文件都应该导出一个默认函数来处理一个请求。 59 | 60 | ```js 61 | export default async (req, res) => { 62 | req.someValue = true; 63 | }; 64 | ``` 65 | 66 | 关于` req``res ` 对象没有什么不同,因此键入它们很简单。 67 | 68 | ```ts 69 | import type { IncomingMessage, ServerResponse } from "http"; 70 | 71 | export default async (req: IncomingMessage, res: ServerResponse) => { 72 | req.someValue = true; 73 | }; 74 | ``` 75 | 76 | -------------------------------------------------------------------------------- /docs/usage/nuxt-app.md: -------------------------------------------------------------------------------- 1 | # [NuxtApp](https://v3.nuxtjs.org/docs/usage/nuxt-app) 2 | 3 | 在 Nuxt3,你可以在组合函数、组件以及插件中获取运行时app上下文。 4 | 5 | 在 Nuxt2,这被称为 [Nuxt上下文](https://nuxtjs.org/docs/internals-glossary/context/#the-context)。 6 | 7 | ## 获取 NuxtApp 8 | 9 | 在组合函数、组件以及插件中通过 useNuxtApp 访问 nuxtApp 实例。 10 | 11 | ```ts 12 | import { useNuxtApp } from '#app' 13 | 14 | function useMyComposable () { 15 | const nuxtApp = useNuxtApp() 16 | // 获取运行时nuxtApp实例 17 | } 18 | ``` 19 | 20 | 为了便利,插件也可以接收 nuxtApp 作为第一个参数。[查看更多关于插件的内容](https://v3.nuxtjs.org/docs/directory-structure/plugins/)。 21 | 22 | ::: info 注意: 23 | 👉 `useNuxtApp` (在服务端) 仅仅能在 `setup` 期间,或是在 `Nuxt 插件`中、`生命周期钩子函数`中才能被使用。 24 | ::: 25 | 26 | ## 提供助手 27 | 您可以为所有组合函数以及所有应用提供助手,这通常出现在一个Nuxt插件里。 28 | 29 | ```ts 30 | const nuxtApp = useNuxtApp() 31 | nuxtApp.provide('hello', (name) => `Hello ${name}!`) 32 | 33 | console.log(nuxtApp.$hello('name')) // 打印 "Hello name!" 34 | ``` 35 | 36 | 在Nuxt2插件里,这被定义为注入方法。 37 | 38 | ::: tip 39 | 👉 通过返回一个带有提供秘钥的对象来注入帮助。[详细请查阅插件文档](https://v3.nuxtjs.org/docs/directory-structure/plugins) 40 | ::: 41 | 42 | ## NuxtApp 接口 (高级) 43 | nuxtApp具有以下属性: 44 | 45 | **(注意:这是一个内部接口,在稳定版本发布之前,一些属性可能随时改变)** 46 | 47 | ``` ts 48 | const nuxtApp = { 49 | vueApp, // 全局Vue应用: https://v3.vuejs.org/api/application-api.html 50 | 51 | // 这些是供开发者调用,并添加运行时NuxtApp实例上的钩子 52 | // https://github.com/nuxt/framework/blob/main/packages/nuxt3/src/app/nuxt.ts#L18 53 | hooks, 54 | hook, 55 | callHook, 56 | 57 | // 仅在服务端使用 58 | ssrContext: { 59 | url, 60 | req, 61 | res, 62 | runtimeConfig, 63 | noSSR, 64 | }, 65 | 66 | // 在从服务端传递到客户端时,这将会被序列化 67 | payload: { 68 | serverRendered: true, 69 | data: {}, 70 | state: {} 71 | } 72 | 73 | provide: (name: string, value: any) => void 74 | } 75 | ``` 76 | 77 | 通过查看[源代码](https://github.com/nuxt/framework/blob/main/packages/nuxt3/src/app/nuxt.ts#L28-L53),获取更多信息。 -------------------------------------------------------------------------------- /docs/directory-structure/layouts.md: -------------------------------------------------------------------------------- 1 | # 布局目录 [Layouts directory](https://v3.nuxtjs.org/docs/directory-structure/layouts) 2 | 3 | Nuxt 提供了一个可定制的布局架构,您可以在整个应用程序中使用它,非常适合将常见的 UI 或代码模式提取到可重用的布局组件中。 4 | 5 | 页面布局放置在 `layouts/` 目录中,使用时会通过异步导入自动加载。 如果你创建了一个 `layouts/default.vue` 这将用于你应用中的所有页面。 通过将 `layout` 属性设置为组件选项的一部分来使用其他布局。 6 | 7 | 如果您的应用程序中只有一个布局,您也可以使用 [app.vue](https://v3.nuxtjs.org/docs/directory-structure/app)。 8 | 9 | ## 自定义布局 10 | 11 | ```bash 12 | -| layouts/ 13 | ---| custom.vue 14 | ``` 15 | 16 | 在你的布局文件中,你需要使用 `` 来定义你的布局页面内容的加载位置。 例如: 17 | 18 | ```vue 19 | 25 | ``` 26 | 27 | 根据上面的示例,您可以使用这样的自定义布局: 28 | 29 | ```vue 30 | 35 | ``` 36 | 37 | ## 与 `` 一起使用 38 | 39 | 您还可以通过使用 `` 组件(该组件在整个应用程序中都可用)和在组件选项中设置 `layout: false` 来获得完全的控制权(例如,使用 slots)。 40 | 41 | ```vue 42 | 49 | 50 | 55 | ``` 56 | 57 | ## 与 ` 93 | 94 | 97 | ``` 98 | -------------------------------------------------------------------------------- /docs/usage/state.md: -------------------------------------------------------------------------------- 1 | # State 2 | 3 | **Nuxt 提供可组合的 `useState` 来创建跨组件的并且对 SSR 友好的响应式状态。** 4 | 5 | `useState` 是一个 SSR 友好的 `ref` 替代品。它的值将会在服务端渲染(客户端渲染期间)后保留,并且使用唯一的键在所有组件之间共享。 6 | 7 | ## 签名 8 | 9 | ```TypeScript 10 | useState(key: string, init?: () => T): Ref 11 | ``` 12 | 13 | 14 | - **key** :唯一的键确保数据请求能够正确并且不被重复 15 | 16 | - **init** :在 state 还未初始化时提供初始值的函数 17 | 18 | - **T** :(仅用作于 typescript )描述 state 的类型 19 | 20 | :::info 👉 21 | `useState` 仅在 `setup` 和 `生命周期钩子` 中生效。 22 | 23 |
24 | ::: 25 | 26 | ## 最佳实践 27 | 28 | 29 | :::danger 🚨 30 | 请不要在` 48 | 49 | 60 | ``` 61 | 62 | 63 | [在 StackBlitz 中打开](https://stackblitz.com/github/nuxt/framework/tree/main/examples/use-state?file=app.vue&terminal=dev) 64 | 65 | ### 高级用法 66 | 67 | 在这个例子中,我们使用一个 composables 从 HTTP 请求头中获取用户默认的环境保存然后在一个名为 `local` 的状态中。 68 | 69 | [在 StackBlitz 中打开](https://stackblitz.com/github/nuxt/framework/tree/main/examples/locale?file=app.vue&terminal=dev) 70 | 71 | ### 共享状态 72 | 73 | 通过使用[自动导入 composables](/directory-structure/composables),我们可以定义全局的安全类型状态并且在整个应用中导入。 74 | 75 | ```typescript 76 | // composables/states.ts 77 | export const useCounter = () => useState('counter', () => 0) 78 | export const useColor = () => useState('color', () => 'pink') 79 | ``` 80 | 81 | 82 | ```vue 83 | 86 | 87 | 90 | ``` 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/directory-structure/plugins.md: -------------------------------------------------------------------------------- 1 | # 插件 [plugins](https://v3.nuxtjs.org/docs/directory-structure/plugins) 2 | 3 | # 插件目录 4 | 5 | Nuxt 将自动读取"plugins"目录中的文件并加载它们。如果仅想在服务器端或客户端加载插件时,可以在文件名中使用`.server`或`.client`后缀。 6 | 7 | ::alert{type=warning} 8 | `plugins/`目录中的所有插件都是自动注册的,因此您不应将它们单独添加到"nuxt.config"中。 9 | :: 10 | 11 | ## 创建插件 12 | 13 | 传递给插件的唯一参数是 [`nuxtApp`](https://v3.nuxtjs.org/docs/usage/nuxt-app). 14 | 15 | ```ts 16 | import { defineNuxtPlugin } from "#app" 17 | 18 | export default defineNuxtPlugin((nuxtApp) => { 19 | // Doing something with nuxtApp 20 | }) 21 | ``` 22 | 23 | ## 自动提供 helper 功能 24 | 25 | 如果您想在`NuxtApp`实例上提供 helper 功能,只需在插件中`provide`键值返回即可。例如: 26 | 27 | ```ts 28 | import { defineNuxtPlugin } from "#app" 29 | 30 | export default defineNuxtPlugin(() => { 31 | return { 32 | provide: { 33 | hello: () => "world", 34 | }, 35 | } 36 | }) 37 | ``` 38 | 39 | 在另一个文件中,您可以使用以下内容: 40 | 41 | ```vue 42 | 47 | 48 | 52 | ``` 53 | 54 | ## 自动猜测类型的插件 55 | 56 | 如果您从插件返回 helpers,它们将被自动加上类型;如果调用`useNuxtApp()`,你会在这个返回值发现它们的类型,在您的模板中也是这样自动处理。 57 | 58 | ::alert 59 | 如果您需要*在*另一个插件中使用提供的 helper,则可以调用`useNuxtApp()`来获取类型的版本。但一般来说应避免这种情况,除非您确定插件的调用顺序。 60 | :: 61 | 62 | ### 高级用法 63 | 64 | 对于高级用例,您可以声明注入属性的类型,如下所示: 65 | 66 | ```ts [index.d.ts] 67 | declare module "#app" { 68 | interface NuxtApp { 69 | $hello(msg: string): string 70 | } 71 | } 72 | 73 | declare module "@vue/runtime-core" { 74 | interface ComponentCustomProperties { 75 | $hello(msg: string): string 76 | } 77 | } 78 | 79 | export {} 80 | ``` 81 | 82 | ## Vue 插件 83 | 84 | 如果你想使用 Vue 插件,比如 [vue-gtag](https://github.com/MatteoGabriele/vue-gtag) 来添加 Google Analytics 标签,你可以使用 Nuxt 插件来做到这一点。 85 | 86 | > 有一个开放的 RFC 可以使这更容易!参见 [nuxt/framework#1175](https://github.com/nuxt/framework/discussions/1175) 87 | 88 | 首先安装所需的插件。 89 | 90 | ```bash 91 | yarn add --dev vue-gtag-next 92 | ``` 93 | 94 | 然后创建一个插件文件`plugins/vue-gtag.client.js`。 95 | 96 | ```ts 97 | import { defineNuxtPlugin } from "#app" 98 | import VueGtag from "vue-gtag-next" 99 | 100 | export default defineNuxtPlugin((nuxtApp) => { 101 | nuxtApp.vueApp.use(VueGtag, { 102 | property: { 103 | id: "GA_MEASUREMENT_ID", 104 | }, 105 | }) 106 | }) 107 | ``` 108 | -------------------------------------------------------------------------------- /docs/.vitepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "Nuxt3中文文档", 3 | description: "由Nuxt3对赌学习群产出的中文文档", 4 | base: "/nuxt3-docs-zh/", 5 | head: [["link", { rel: "icon", href: "/nuxt3-docs-zh/icon.png" }]], 6 | themeConfig: { 7 | repo: "57code/nuxt3-docs-zh", 8 | docsBranch: "master/docs", 9 | logo: "/logo.svg", 10 | nav: [ 11 | { text: "学习指南", link: "/getting-started/installation" }, 12 | { text: "模块", link: "https://modules.nuxtjs.org/?version=3.x" }, 13 | { text: "在线编辑", link: "https://stackblitz.com/edit/nuxt-starter-ndtolw" }, 14 | { 15 | text: "更新日志", 16 | link: "https://github.com/57code/nuxt3-docs-zh", 17 | }, 18 | ], 19 | sidebar: [ 20 | { 21 | text: "快速入门", 22 | children: [{ text: "安装", link: "/getting-started/installation" }], 23 | }, 24 | { 25 | text: "使用", 26 | children: [ 27 | { text: "数据获取", link: "/usage/data-fetching" }, 28 | { text: "State", link: "/usage/state" }, 29 | { text: "运行时配置", link: "/usage/runtime-config" }, 30 | { text: "NuxtApp", link: "/usage/nuxt-app" }, 31 | { text: "Cookies", link: "/usage/cookies" }, 32 | ], 33 | }, 34 | { 35 | text: "目录结构", 36 | children: [ 37 | { text: "components", link: "/directory-structure/components" }, 38 | { text: "composables", link: "/directory-structure/composables" }, 39 | { text: "layouts", link: "/directory-structure/layouts" }, 40 | { text: "pages", link: "/directory-structure/pages" }, 41 | { text: "plugins", link: "/directory-structure/plugins" }, 42 | { text: "server", link: "/directory-structure/server" }, 43 | { text: "app.vue", link: "/directory-structure/app-vue" }, 44 | { text: ".gitignore", link: "/directory-structure/gitignore" }, 45 | { text: "nuxt.config.ts", link: "/directory-structure/nuxt-config" }, 46 | { text: "tsconfig.json", link: "/directory-structure/tsconfig" }, 47 | ], 48 | }, 49 | { 50 | text: "部署", 51 | children: [ 52 | { text: "Azure", link: "/deployment/azure" }, 53 | { text: "PM2", link: "/deployment/pm2" }, 54 | { text: "Netlify", link: "/deployment/netlify" }, 55 | { text: "Vercel", link: "/deployment/vercel" }, 56 | ], 57 | }, 58 | ], 59 | editLinks: true, 60 | editLinkText: "在 GitHub 上编辑此页", 61 | lastUpdated: "上次更新", 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /docs/directory-structure/pages.md: -------------------------------------------------------------------------------- 1 | # 路由页面 [pages](https://v3.nuxtjs.org/docs/directory-structure/pages) 2 | 3 | > pages 文件夹目录是可选的,也就是说你可以只通过app.vue 来完成你的项目, 4 | > 但我们没有pages文件夹目录时,vue-router是不会被加载的,这样可以减小包的大小 5 | 6 | 当我们创建了pages文件夹目录后,Nuxt会自动集成[vue-router](https://next.router.vuejs.org/zh/),结合pages目录下的文件(夹)名来构建我们的项目 7 | 8 | > 与组件不同的是,我们的页面必须有一个单一的根元素,以允许Nuxt在页面之间应用路由转换。 9 | 10 | ## 动态路由 - Dynamic Routes 11 | 12 | 如果把任何东西放在方括号`[]`中,它将被转换为一个[**dynamic router**](https://next.router.vuejs.org/zh/guide/essentials/dynamic-matching.html)参数。您可以在一个文件名或目录中混合和匹配多个参数,甚至是非动态文本。 13 | 14 | 如果需要一个通配路由,可以使用一个名为`[…slug].vue`的文件来创建它。这将匹配该路径下的所有路由,因此它不支持任何非动态文本。 15 | 16 | #### 示例 :chestnut: 17 | 18 | ``` 19 | -| pages/ 20 | ---| index.vue 21 | ---| users-[group]/ 22 | -----| [id].vue 23 | ``` 24 | 25 | 26 | 在上面的例子中,可以通过 $route 对象访问组件中的参数 group/id: 27 | 28 | ```vue 29 | 33 | ``` 34 | 35 | 当路由跳转到 /user-admins/123 时,将会渲染出 36 | 37 | ``` 38 | admins 123 39 | ``` 40 | 41 | ## 导航 - Navigation 42 | 43 | 要在应用程序的页面之间导航,你应该使用``组件。该组件包含在Nuxt中,因此您不必像导入其他组件那样导入它。它类似于HTML的``标签,除了使用``。如果你以前用过vue-router,你可以把``看作是``的替换。 44 | 45 | 一个到索引的简单链接。Vue页面在您的页面文件夹: 46 | ```vue 47 | 50 | ``` 51 | 52 | ``组件应该用于所有内部链接。这意味着对于所有指向站点内页面的链接,您应该使用``。``标签应该用于所有外部链接。这意味着,如果你有链接到其他网站,你应该使用``标签。 53 | 54 | ```vue 55 | 64 | ``` 65 | 66 | > 如果你想了解更多关于``的信息,请阅读[Vue Router文档](https://next.router.vuejs.org/zh/api/index.html#router-link)获取更多信息。 67 | 68 | ## 嵌套路由 - Nested Router 69 | 70 | 我们为``组件提供了一个语义别名``,用于显示嵌套路由的子组件。在Nuxt应用里我们用``组件来替代vue-router里的`` 71 | > 可以参考vue-router的[嵌套路由](https://next.router.vuejs.org/zh/guide/essentials/nested-routes.html) 72 | 73 | #### 示例 :chestnut: 74 | ``` 75 | -| pages/ 76 | ---| parent/ 77 | ------| child.vue 78 | ---| parent.vue 79 | ``` 80 | 81 | Nuxt将为我们生成下面的路由 82 | ```js 83 | [ 84 | { 85 | path: '/parent', 86 | component: '~/pages/parent.vue', 87 | name: 'parent', 88 | children: [ 89 | { 90 | path: 'child', 91 | component: '~/pages/parent/child.vue', 92 | name: 'parent-child' 93 | } 94 | ] 95 | } 96 | ] 97 | ``` 98 | 99 | 展示`child.vue`组件时,你必须在`pages/parent.vue`中插入``组件: 100 | ```vue 101 | 107 | ``` 108 | 109 | -------------------------------------------------------------------------------- /docs/usage/runtime-config.md: -------------------------------------------------------------------------------- 1 | # 运行时配置 [Runtime Config](https://v3.nuxtjs.org/docs/usage/runtime-config/) 2 | 3 | Nuxt 提供了一个 API,用于在应用程序和 API 路由中定义运行时配置。 4 | 5 | ## 公开运行时配置 Exposing runtime config 6 | 7 | 为了向应用程序的其他部分公开配置和环境变量,您需要在 `nuxt.config` 文件中定义运行时配置,可以使用 8 | [`privateRuntimeConfig` 或 `publicRuntimeConfig` 选项](https://v3.nuxtjs.org/docs/directory-structure/nuxt.config#privateruntimeconfig)(根据您是否希望在应用程序的客户端部分可以访问它来选择使用)。 9 | 10 | **示例:** 11 | 12 | ```ts [nuxt.config.ts] 13 | export default defineNuxtConfig({ 14 | publicRuntimeConfig: { 15 | API_BASE: '/api' 16 | }, 17 | privateRuntimeConfig: { 18 | API_SECRET: '123' // 仅服务端可用,会覆盖publicRuntimeConfig的配置 19 | } 20 | }) 21 | ``` 22 | 23 | 在将 `API_BASE` 添加到 `publicRuntimeConfig` 时,Nuxt 会将其添加到页面的有效负载中。这样我们就可以在服务器和浏览器中访问 `API_BASE`。 24 | 25 | ### 环境变量 Environment Variables 26 | 27 | 提供配置的最常用方法是使用 [环境变量](https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa) 。 28 | Nuxt CLI 内置 [dotenv](https://github.com/motdotla/dotenv) 支持。 29 | 30 | 除了一些进程(process)环境变量之外,如果在项目的根目录中有一个 `.env` 文件,它将自动加载到 `process.env` 中,并且可以在 `nuxt.config` 文件和模块中访问。 31 | 32 | **示例:** 33 | 34 | ```sh [.env] 35 | BASE_URL=https://nuxtjs.org 36 | API_SECRET=api_secret_token 37 | ``` 38 | 39 | ```ts [nuxt.config.ts] 40 | export default defineNuxtConfig({ 41 | publicRuntimeConfig: { 42 | BASE_URL: process.env.BASE_URL 43 | }, 44 | privateRuntimeConfig: { 45 | API_SECRET: process.env.API_SECRET 46 | } 47 | }) 48 | ``` 49 | 50 | :::tip 💡 提示: 51 | 虽然没有必要,但是通过使用相同的运行时配置名称作为 env 变量,您可以在生产环境中使用平台环境变量轻松地覆盖它们。 52 | ::: 53 | 54 | ## 访问运行时配置 Accessing runtime config 55 | 56 | ### Vue 实例中 57 | 58 | 在 Nuxt 应用程序的 Vue 实例中,需要调用 `useRuntimeConfig()` 来访问运行时配置。 59 | 60 | ::: info 注意:客户端和服务器端的行为是不同的 61 | 62 | - 在客户端,只有 `publicRuntimeConfig` 可用,并且该对象是**可修改的响应式对象**。 63 | - 在服务器端,`publicRuntimeConfig` 和 `privateRuntimeConfig` 被合并并且对象是**只读的**以避免上下文共享。 64 | 65 | ::: 66 | 67 | ```vue 68 | 73 | 74 | 77 | ``` 78 | 79 | ::: warning 安全注意: 80 | 如果`API_AUTH_TOKEN` 是私有配置,请不要使用上面的示例。 即使您使用`privateRuntimeConfig`,您仍然必须小心不要将此类配置暴露给**有效负载**或**html**! 81 | ::: 82 | 83 | ::: info 注意: 84 | 👉 **`useRuntimeConfig` 仅在 `setup函数` 或 `生命周期钩子` 内有效** 85 | ::: 86 | 87 | ### API 路由 API routes 88 | 89 | 在 API 路由中,您可以通过直接从虚拟 `#config` 导入来访问运行时配置。 90 | 91 | ```ts 92 | import config from '#config' 93 | 94 | export default async () => { 95 | const result = await $fetch('https://my.api.com/test', { 96 | headers: { 97 | Authorization: `Bearer ${config.API_AUTH_TOKEN}` 98 | } 99 | }) 100 | return result 101 | } 102 | ``` 103 | 104 | ### 输入运行时配置 Typing runtime config 105 | 106 | 目前可以手动输入运行时配置文件。 107 | 108 | ```ts [index.d.ts] 109 | declare module '@nuxt/schema' { 110 | interface PublicRuntimeConfig { 111 | testConfig: string 112 | } 113 | interface PrivateRuntimeConfig { 114 | token: string 115 | } 116 | } 117 | // 确保在扩充类型时 import/export 某些比较重要的内容 118 | export {} 119 | ``` 120 | -------------------------------------------------------------------------------- /docs/directory-structure/components.md: -------------------------------------------------------------------------------- 1 | --- 2 | icon: IconDirectory 3 | title: "components" 4 | head.title: Components directory 5 | --- 6 | 7 | # 组件目录 8 | 9 | `components/` 目录是存放可导入到你的页面中的 Vue 组件或其他组件 ([了解更多](https://v3.cn.vuejs.org/guide/component-basics.html))。 10 | 11 | Nuxt 会自动导入 `components/` 目录下任何组件 (以及你可能正在使用的任何模块注册的组件)。 12 | 13 | ```bash 14 | | components/ 15 | --| TheHeader.vue 16 | --| TheFooter.vue 17 | ``` 18 | 19 | ``` vue 20 | 27 | ``` 28 | 29 | ## 组件命名 30 | 31 | 如你的嵌套目录中有一个组件,例如: 32 | 33 | ```bash 34 | | components/ 35 | --| base/ 36 | ----| foo/ 37 | ------| Button.vue 38 | ``` 39 | 40 | ... 然后组件的名称将基于自己的路径和文件名,并删除重复的段 (比如: an/an/Button.vue 注册名将会是 AnButton)。因此组件名会是: 41 | 42 | ```vue 43 | 44 | ``` 45 | 46 | ::: info 提示: 47 | 为清楚起见,建议组件的文件名与其名称匹配。 (所以,在上面的例子中, 你可以将 `Button.vue` 重命名为 `BaseFooButton.vue`.) 48 | ::: 49 | 50 | ## 动态导入 51 | 52 | 要动态导入一个组件 (也称为懒加载一个组件) 只需要在原组件名前加上 `Lazy` 前缀. 53 | 54 | ```vue 55 | 62 | ``` 63 | 64 | 当该组件不是总被需要,这一点特别重要。通过使用 `Lazy` 前缀,你可以在合适的时机,延迟加载组件代码,这有助于优化你的 JavaScript 包大小。 65 | 66 | ```vue 67 | 74 | 75 | 84 | ``` 85 | 86 | ## `` 组件 87 | 88 | Nuxt 提供了 `` 组件,是专门在客户端渲染组件的组件。只在客户端导入组件或在客户端插件中注册该组件。 89 | 90 | ```vue 91 | 101 | ``` 102 | 103 | 使用一个插槽,如: fallback ,直到 `` 组件在客户端挂载。 104 | 105 | ```vue 106 | 119 | ``` 120 | 121 | ## 库作者 122 | 123 | 制作具有自动摇树优化和组件注册功能的 Vue 组件库非常简单 ✨ 124 | 125 | 你可以使用 `components:dirs` 钩子,轻松扩展目录列表,而无需用户在 Nuxt 模块中进行配置。 126 | 127 | 想象一个像这样的目录结构: 128 | 129 | ```bash 130 | | node_modules/ 131 | ---| awesome-ui/ 132 | ------| components/ 133 | ---------| Alert.vue 134 | ---------| Button.vue 135 | ------| nuxt.js 136 | | pages/ 137 | ---| index.vue 138 | | nuxt.config.js 139 | ``` 140 | 141 | 然后在 `awesome-ui/nuxt.js` 中,你就可以使用 `components:dirs` 钩子: 142 | 143 | ```js 144 | import { join } from "pathe"; 145 | import { defineNuxtModule } from "@nuxt/kit"; 146 | 147 | export default defineNuxtModule({ 148 | hooks: { 149 | "components:dirs"(dirs) { 150 | // Add ./components dir to the list 151 | dirs.push({ 152 | path: join(__dirname, "components"), 153 | prefix: "awesome", 154 | }); 155 | }, 156 | }, 157 | }); 158 | ``` 159 | 160 | 就是这样! 现在在你的项目中, 你可以将你的 ui 库作为 Nuxt 模块导入到你的 `nuxt.config` 文件中: 161 | 162 | ```js 163 | export default { 164 | buildModules: ["awesome-ui/nuxt"], 165 | }; 166 | ``` 167 | 168 | ... 就可以直接在我们的 `pages/index.vue`中,使用模块组件 (带 `awesome-` 前缀): 169 | 170 | ```vue 171 | 177 | ``` 178 | 179 | 它仅在使用时自动导入组件,并且在更新你在 `node_modules/awesome-ui/components/` 的组件时支持热更新。 180 | -------------------------------------------------------------------------------- /docs/usage/cookies.md: -------------------------------------------------------------------------------- 1 | # Cookies 2 | 3 | Nuxt为读取和写入cookies提供了一套针对服务端渲染友好的组合式api 4 | 5 | ## 使用 6 | 7 | 在你的页面、组件或者是插件中,针对一条特定的cookie记录,可以使用`useCookie`创建一条响应式的引用。 8 | 9 | ```js 10 | const cookie = useCookie(name, options) 11 | ``` 12 | 13 | 👉`useCookie`只在`setup`或`Lifecycle Hooks`中有效 14 | 15 | 😌`useCookie` ref将自动转义cookie的值成JSON格式。 16 | 17 | ## [示例](https://v3.nuxtjs.org/docs/usage/cookies#example) 18 | 19 | 下面的例子创建了一条称为counter的cookie记录。如果这条cookie记录不存在,那么在初始化这条记录时可以把它设置成一个任意值。无论何时当我们更新了counter变量的值的时候,这条cookie记录也会相应的自动更新。 20 | 21 | ```html 22 | 36 | 37 | 41 | ``` 42 | 43 | :::danger 注意 44 | 示例报错reading 'default',需要 45 | const counter = useCookie('counter', { 46 | default: ()=>0 47 | }) 48 | ::: 49 | 50 | [StackBlitz打开](https://stackblitz.com/github/nuxt/framework/tree/main/examples/use-cookie?terminal=dev) 51 | 52 | ## [配置项](https://v3.nuxtjs.org/docs/usage/cookies#options) 53 | 54 | 组合式Cookie接受几个配置项来让你修改cookie的行为。 55 | 56 | 大部分配置项是直接引用的 [cookie ](https://github.com/jshttp/cookie)包中的内容。 57 | 58 | ### [`maxAge` / `expires`](https://v3.nuxtjs.org/docs/usage/cookies#maxage--expires) 59 | 60 | **`maxAge`** 明确规定了响应头中`Set-Cookie`的`Max-Age`属性值,该属性接收`number`类型,单位秒。默认不设置最大超时时间。 61 | 62 | **`expires`**:明确规定了响应头中`Set-Cookie`的`Expires`属性值,该属性接收`Date`类型。默认不设置该值。 大部分客户端将它视为“持久化的cookie”,只在例如退出web浏览器应用程序时才会删除cookie。 63 | 64 | 💡**注意:** cookie的存储模型规定如果同时设置了`expires`和`maxAge`,以`maxAge`优先。但是并不是所有的客户端都遵守这一规定,所以同时设置时应该让他们都指向相同的日期和时间! 65 | 66 | 如果都不社会`expires`和`maxAge`,那么cookie将仅用于会话,当用户关闭浏览器的时候被移除。 67 | 68 | ### [`httpOnly`](https://v3.nuxtjs.org/docs/usage/cookies#httponly) 69 | 70 | 明确规定了响应头中`Set-Cookie`的`HttpOnly`属性值,该属性接收`boolean`类型。当`httpOnly`为“真值” 时`HttpOnly`属性被设置,反之不设置。默认`HttpOnly`属性不设置。 71 | 72 | 💡**注意:** 小心当该值被设置成`true`时,合格的客户端是不允许用户侧通过javaScript脚本的方式查看`documnet.cookie`。 73 | 74 | ### [`secure`](https://v3.nuxtjs.org/docs/usage/cookies#secure) 75 | 76 | 明确规定了响应头中`Set-Cookie`的`Secure`属性值,该属性接受`boolean`类型。当secure设置为`true`时,`Secure`被设置,反之不设置。默认`Secure`不设置。 77 | 78 | 💡**注意:** 小心当该值被设置成`true`时,如果当浏览器和服务器没有建立https连接,合格的客户端将不会传输cookie。这可能会导致错误。 79 | 80 | ### [`domain`](https://v3.nuxtjs.org/docs/usage/cookies#domain) 81 | 82 | 明确规定了响应头中`Set-Cookie`的`Domain`属性值。默认`domain`不设置,大部分客户端认为cookie仅适用于当前域。 83 | 84 | ### [`path`](https://v3.nuxtjs.org/docs/usage/cookies#path) 85 | 86 | 明确规定了响应头中`Set-Cookie`的`Path`属性值。默认值为“default path”。 87 | 88 | ### [`sameSite`](https://v3.nuxtjs.org/docs/usage/cookies#samesite) 89 | 90 | 明确规定了响应头中`Set-Cookie`的`SameSite`属性值 91 | 92 | - `true` 将`SameSite`属性值设为`Strict`,以严格执行同站请求。 93 | - `false`不设置`SameSite`属性。 94 | - `'lax'` 将SameSite属性值设为`Lax`,允许部分第三方请求携带 `Cookie`。 95 | - `'none'`允许跨站发送`Cookie`。 96 | - `'strict'`将SameSite属性值设为`Strict`,以严格执行同站请求。 97 | 98 | 关于不同实施级别的更多信息可以在 [规范 ](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7)中查阅。 99 | 100 | ### [`encode`](https://v3.nuxtjs.org/docs/usage/cookies#encode) 101 | 102 | 指定cookie值的编码函数。因为cookie的值是一个有限的字符集(必须是一个简单的字符串),所以该函数需要将值编码为适合cookie的字符串。 103 | 104 | 默认编码方式是 `JSON.stringify` + `encodeURIComponent`。 105 | 106 | ### [`decode`](https://v3.nuxtjs.org/docs/usage/cookies#decode) 107 | 108 | 指定cookie值的解码函数。因为cookie值为一个有限的字符集(必须是一串简单的字符串),该函数需要将编码的cookie值解码成javaScript中的字符串或对象类型。 109 | 110 | 默认解码函数是 `decodeURIComponent` + [destr ](https://github.com/unjs/destr). 111 | 112 | 💡**注意:** 如果在该函数抛出异常,那么原始的未经解码的cookie值将会作为value值返回。 113 | 114 | ## [API路由中处理cookies](https://v3.nuxtjs.org/docs/usage/cookies#handling-cookies-in-api-routes) 115 | 116 | 你可以使用[`h3` ](https://github.com/unjs/h3)包中的`useCookie`和`setCookie`在访问服务器的API路由时候处理cookie的值。 117 | 118 | **示例:** 119 | 120 | ```js 121 | import { useCookie, setCookie } from 'h3' 122 | 123 | export default (req, res) => { 124 | // Read counter cookie 125 | let counter = useCookie(req, 'counter') || 0 126 | 127 | // Increase counter cookie by 1 128 | setCookie(res, 'counter', ++counter) 129 | 130 | // Send JSON response 131 | return { counter } 132 | } 133 | ``` -------------------------------------------------------------------------------- /docs/usage/data-fetching.md: -------------------------------------------------------------------------------- 1 | # 获取数据 2 | 3 | ## 在服务端获取数据 4 | *因为`Nuxt3`是`SSR`的方案,所以你可能不仅仅只是想要在浏览器端发送请求获取数据,还想在服务器端就获取到数据并渲染组件。* 5 | 6 | `Nuxt3`提供了4种方式使得你可以在服务器端异步获取数据 7 | 8 | - useAsyncData 9 | - useLazyAsyncData (useAsyncData+lazy:true) 10 | - useFetch 11 | - useLazyFetch (useFetch+lazy:true) 12 | 13 | > 注意:他们只能在**`setup`**或者是`生命周期钩子`中使用 14 | 15 | ### useAsyncData 16 | 17 | - 项目中可以在`pages`目录、`components`目录和`plugins`目录下使用useAsyncData异步获取数据 18 | 19 | ```js 20 | //用法 21 | const { 22 | data: Ref,// 返回的数据结果 23 | pending: Ref,// 是否在请求状态中 24 | refresh: (force?: boolean) => Promise,// 强制刷新数据 25 | error?: any // 请求失败返回的错误信息 26 | } = useAsyncData( 27 | key: string, // 唯一键,确保相同的请求数据的获取和去重 28 | fn: () => Object,// 一个返回数值的异步函数 29 | options?: { lazy: boolean, server: boolean } 30 | // options.lazy,是否在加载路由后才请求该异步方法,默认为false 31 | // options.server,是否在服务端请求数据,默认为true 32 | // options.default,异步请求前设置数据data默认值的工厂函数(对lazy:true选项特别有用) 33 | // options.transform,更改fn返回结果的函数 34 | // options.pick,只从数组中指定的key进行缓存 35 | ) 36 | ``` 37 | 38 | > 可以考虑设置lazy:true配合loading状态加载器的方式,能够带来更好的用户体验。 39 | 40 | ```js 41 | // server/api/count.ts-例子 42 | let counter = 0 43 | export default () => { 44 | counter++ 45 | return JSON.stringify(counter) 46 | } 47 | ``` 48 | 49 | 50 | 51 | ```js 52 | // app.vue-例子 53 | 56 | 57 | 60 | ``` 61 | 62 | ### useLazyAsyncData 63 | 64 | 这个封装方法等同于是,使用`useAsyncData`方法默认配置了`lazy:true`,执行异步函数时不会阻塞路由的执行。也意味着你必须处理数据为`null`的情况(比如说,在`default`返回的工厂函数中设置一个默认值)。 65 | 66 | ### useFetch 67 | 68 | 在`pages`目录、`components`目录和`plugins`目录下使用`useFetch`也同样可以获取到任意的URL资源。该方法实际上是对useAsyncData和$fetch的封装,提供了一个更便捷的封装方法。(它会根据URL和fetch参数自动生成一个key,同时推断出API的响应类型) 69 | 70 | ```js 71 | //useFetch用法 72 | const { 73 | data: Ref, 74 | pending: Ref, 75 | refresh: (force?: boolean) => Promise, 76 | error?: any 77 | } = useFetch(url: string, options?) 78 | 79 | //可以看到useFetch和useAsyncData的返回对象是一样的,useFetch传参更便捷,不需要在fn中手动使用$fetch 80 | useAsyncData(key: string,fn: () => Object,options?: { lazy: boolean, server: boolean }) 81 | ``` 82 | 83 | 84 | 85 | ```js 86 | //例子 87 | 90 | 91 | 94 | ``` 95 | 96 | 97 | 98 | ### useLazyFetch 99 | 100 | 这个封装方法等同于是,使用`useFetch`方法默认配置了`lazy:true`,执行异步函数时不会阻塞路由的执行。也意味着你必须处理数据为`null`的情况(比如说,在`default`返回的工厂函数中设置一个默认值)。 101 | 102 | 103 | 104 | ## 最佳实践 105 | 106 | ### 只选取你需要使用的数据 107 | 108 | 通过异步请求回来的数据都会存储在页面payload中。意味着,可能会存在没有用在你的组件的数据也加载到了payload中。我们强烈推荐你只选取必须使用在组件上的数据 109 | 110 | ```js 111 | // /api/mountains/everest 112 | { 113 | 114 | "title": "Mount Everest", 115 | "description": "Mount Everest is Earth's highest mountain above sea level, located in the Mahalangur Himal sub-range of the Himalayas. The China–Nepal border runs across its summit point", 116 | "height": "8,848 m", 117 | "countries": [ 118 | "China", 119 | "Nepal" 120 | ], 121 | "continent": "Asia", 122 | "image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Everest_kalapatthar.jpg/600px-Everest_kalapatthar.jpg" 123 | } 124 | ``` 125 | 126 | ```vue 127 | // 组件中只使用到了title和description,useFetch使用option的pick参数来指定key 128 | 131 | 132 | 136 | ``` 137 | 138 | 139 | ### 使用async setup 140 | 141 | 受Vue3的影响,如果你使用了`async setup()`的形式,当前组件的实例会在第一个异步操作之后丢失。如果你想要使用多个异步操作,比如执行多个useFetch,你需要使用` 161 | 162 | 168 | ``` -------------------------------------------------------------------------------- /docs/deployment/azure.md: -------------------------------------------------------------------------------- 1 | # Azure 2 | 3 | 如何将 Nuxt 部署到 Azure 静态 Web 应用或 Azure Functions中 4 | 5 | ## Azure Functions 6 | 7 | - 支持无服务器构建 8 | - 无需配置 9 | - Azure Function 提供静态资源服务 10 | 11 | 12 | ### 设置 13 | 14 | ```ts [nuxt.config.js|ts] 15 | export default { 16 | nitro: { 17 | preset: 'azure_functions' 18 | } 19 | } 20 | ``` 21 | 22 | ::: warning 提示 23 | 如果你遇到问题,请确保你使用的是Node.js 14+ 环境。 你可以在Azure文档中找到更多关于[`如何设置Node版本`](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2#setting-the-node-version)的信息。 24 | ::: 25 | 26 | ### 本地预览 27 | 28 | 如果你想在本地测试,请安装[Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local)。 29 | 30 | 您可以从无服务器目录启动开发环境。 31 | 32 | ```bash 33 | NITRO_PRESET=azure_functions yarn build 34 | cd .output 35 | func start 36 | ``` 37 | 38 | 你现在可以在浏览器中访问 来浏览在 Azure Functions 上本地运行的服务。 39 | 40 | ### 本机部署 41 | 42 | 要部署,只需运行以下命令: 43 | 44 | ```bash 45 | # 发布打包后的压缩文件 46 | az functionapp deployment source config-zip -g -n --src dist/deploy.zip 47 | # 或者您也可以发布源代码 48 | cd dist && func azure functionapp publish --javascript 49 | ``` 50 | 51 | ### 通过 GitHub Actions 从 CI/CD 部署 52 | 53 | 首先,获取您的 Azure Functions 发布配置文件,然后按照[`这些说明`](https://github.com/Azure/functions-action#using-publish-profile-as-deployment-credential-recommended)将其作为密钥添加到您的 GitHub 存储库设置中。 54 | 55 | 然后创建以下文件作为工作流: 56 | 57 | ```yml{}[.github/workflows/azure.yml] 58 | name: azure 59 | on: 60 | push: 61 | branches: 62 | - main 63 | pull_request: 64 | branches: 65 | - main 66 | jobs: 67 | deploy: 68 | runs-on: ${{ matrix.os }} 69 | strategy: 70 | matrix: 71 | os: [ ubuntu-latest ] 72 | node: [ 14 ] 73 | steps: 74 | - uses: actions/setup-node@v2 75 | with: 76 | node-version: ${{ matrix.node }} 77 | 78 | - name: Checkout 79 | uses: actions/checkout@master 80 | 81 | - name: Get yarn cache directory path 82 | id: yarn-cache-dir-path 83 | run: echo "::set-output name=dir::$(yarn cache dir)" 84 | 85 | - uses: actions/cache@v2 86 | id: yarn-cache 87 | with: 88 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 89 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 90 | restore-keys: | 91 | ${{ runner.os }}-yarn-azure 92 | 93 | - name: Install Dependencies 94 | if: steps.cache.outputs.cache-hit != 'true' 95 | run: yarn 96 | 97 | - name: Build 98 | run: npm run build 99 | env: 100 | NITRO_PRESET: azure_functions 101 | 102 | - name: 'Deploy to Azure Functions' 103 | uses: Azure/functions-action@v1 104 | with: 105 | app-name: 106 | package: .output/deploy.zip 107 | publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} 108 | ``` 109 | 110 | ### 优化 Azure Functions 111 | 112 | 可以考虑 [`启用从压缩包运行`](https://docs.microsoft.com/en-us/azure/app-service/deploy-run-package) ,从而支持直接通过 zip 文件运行您的应用程序。这可以加速冷启动。 113 | 114 | ### 例子 115 | 116 | 提供了在线演示。 117 | 118 | ## Azure 静态 Web 应用 119 | 120 | ::: warning 提示 121 | Azure 静态 Web 应用当前环境默认为 Node.js 12.x ,这意味着它与 Nuxt Nitro 不兼容。目前,您可以改为通过 [Azure Functions](#azure-functions) 进行部署。 122 | ::: 123 | 124 | 如何使用 Nuxt Nitro 将 Nuxt 部署到 Azure 静态 Web 应用。 125 | 126 | 127 | - 支持无服务器 SSR 构建 128 | - 部署时自动检测 129 | - 极少的配置 130 | 131 | ### 设置 132 | 133 | Azure 静态 Web 应用程序旨在 [GitHub Actions workflow](https://docs.microsoft.com/en-us/azure/static-web-apps/github-actions-workflow)中持续部署。 默认情况下,Nitro 将检测此部署环境并启用 `azure` 预设。 134 | 135 | ### 本地预览 136 | 137 | 您可以在部署前运行开发环境进行预览。 138 | 139 | ```bash 140 | NITRO_PRESET=azure yarn build 141 | npx @azure/static-web-apps-cli start .output/public --api-location .output/server 142 | ``` 143 | 144 | ### 通过 GitHub Actions 进行 CI/CD 部署 145 | 146 | 将 GitHub 存储库链接到 Azure 静态 Web 应用时,会向存储库添加一个工作流文件。 147 | 148 | 当系统要求您选择框架时,请选择自定义并提供以下信息: 149 | 150 | | Input | Value | 151 | | --- | --- | 152 | | **app_location** | '/' | 153 | | **api_location** | '.output/server' | 154 | | **output_location** | '.output/public' | 155 | 156 | 如果您错过了这一步,您仍然可以在工作流程中找到构建配置部分并更新构建配置: 157 | 158 | ```yml{}[.github/workflows/azure-static-web-apps-.yml] 159 | ###### Repository/Build Configurations ###### 160 | app_location: '/' 161 | api_location: '.output/server' 162 | output_location: '.output/public' 163 | ###### End of Repository/Build Configurations ###### 164 | ``` 165 | 166 | #### 说明 167 | 168 | 等待 [`Azure 静态 Web 应用工作流`](https://github.com/Azure/static-web-apps-deploy) 中的更新,您还需要在根目录中运行以下命令: 169 | 170 | ```bash 171 | mkdir -p .output/server 172 | touch .output/server/.gitkeep 173 | git add -f .output/server/.gitkeep 174 | ``` 175 | 176 | 就是这样!现在,Azure 静态 Web 应用程序将在推送时自动部署到由 Nitro 驱动的 Nuxt 应用程序。 177 | -------------------------------------------------------------------------------- /docs/directory-structure/nuxt-config.md: -------------------------------------------------------------------------------- 1 | # hello nuxt3 2 | 3 | # Nuxt 配置文件 [Nuxt configuration file](https://v3.nuxtjs.org/docs/directory-structure/nuxt.config) 4 | 5 | Nuxt 可以用一个 `nuxt.config` 文件轻松配置,该文件的扩展名可以是 `.js`、`.ts` 或 `.mjs` 6 | 7 | ```ts 8 | import { defineNuxtConfig } from "nuxt3" 9 | 10 | export default defineNuxtConfig({ 11 | // 我的 Nuxt 配置 12 | }) 13 | ``` 14 | 15 | 了解更多关于所有不同配置属性的信息 16 | 17 | ## 别名 alias 18 | 19 | 您可以通过定义额外的别名来访问 JavaScript 和 CSS 中的自定义目录来改进开发体验。 20 | 21 | - **类型:** `object` 22 | - **默认值** 23 | ```json 24 | { 25 | "~~": "/project", 26 | "@@": "/project", 27 | "~": "/project", 28 | "@": "/project", 29 | "assets": "/project/assets", 30 | "public": "/project" 31 | } 32 | ``` 33 | - **版本:2, 3** 34 | 35 | ::: info 注意: 36 | 37 | - 在 webpack 上下文(图像源、CSS - 但不是 JavaScript)中,您必须通过在别名前加上 `~` 来访问别名。 38 | - 如果您正在使用 TypeScript 并希望使用您在 TypeScript 文件中定义的别名,则需要将别名添加到 `tsconfig.json` 中的 `paths` 对象。 39 | 40 | ::: 41 | 42 | **示例:** 43 | 44 | 45 | ```js 46 | import { resolve } from 'pathe' 47 | export default { 48 | alias: { 49 | 'images': resolve(__dirname, './assets/images'), 50 | 'style': resolve(__dirname, './assets/style'), 51 | 'data': resolve(__dirname, './assets/other/data') 52 | } 53 | } 54 | ``` 55 | 56 | 57 | ## 构建目录 buildDir 58 | 59 | 定义构建后的 Nuxt 文件的存放目录。 60 | 61 | - **类型:** `string` 62 | - **默认值:** `"/project/.nuxt"` 63 | - **版本:2, 3** 64 | 65 | :::tip 💡 提示: 66 | 67 | 许多工具假定 `.nuxt` 是一个隐藏目录(因为它以 `.` 开头)。 如果因此出现问题,您可以使用此选项来防止这种情况发生。 68 | 69 | ::: 70 | 71 | **示例:** 72 | 73 | ```js 74 | export default { 75 | buildDir: "nuxt-build", 76 | } 77 | ``` 78 | 79 | ## 构建期模块 buildModules 80 | 81 | > 仅在开发和构建期间需要的模块。 82 | 83 | - **类型:** `array` 84 | - **版本:2, 3** 85 | 86 | 模块是 Nuxt 扩展,可以扩展其核心功能并添加无限的集成。 87 | Nuxt 尝试使用 node require 路径(在 `node_modules` 中)解析 modules 数组中的每个项目,然后如果使用 `~` 别名,将从项目 `srcDir` 解析。 88 | 89 | ::: tip 构建期模块 buildModules 有三种声明形式: 90 | 91 | - 一个 `字符串`(可以指一个包,也可以是一个文件的路径) 92 | - 以模块字符串作为第一项,以选项对象作为第二项的 `元组` 93 | - 一个 `内联模块函数` 94 | 95 | ::: 96 | 97 | **示例:** 98 | 99 | ```js 100 | modules: [ 101 | // 使用包名 102 | "@nuxtjs/axios", 103 | // 与项目 srcDir 地相对路径 104 | "~/modules/awesome.js", 105 | // 携带配置选项 106 | ["@nuxtjs/google-analytics", { ua: "X1234567" }], 107 | // 内联函数 108 | function () {}, 109 | ] 110 | ``` 111 | 112 | ::: info 注意: 113 | 114 | - 模块按顺序执行,因此顺序很重要。 115 | - 使用`buildModules` 有助于加快生产启动速度,并显着减少生产部署中`node_modules` 的大小。请参考各 116 | 模块的文档,看看是否推荐使用`modules` 或`buildModules`。 117 | 118 | ::: 119 | 120 | ## 样式 css 121 | 122 | - **类型:** `array` 123 | - **版本:2, 3** 124 | 125 | > 您可以定义要全局设置的 `CSS 文件` / `模块` / `库`(包含在每个页面中)。 126 | 127 | Nuxt 会自动根据扩展名猜测文件类型,并使用适当的预处理器。如果需要使用所需的加载程序,您仍然需要安装这些 **loader** 。 128 | **示例:** 129 | 130 | ```js 131 | css: [ 132 | // 直接加载一个 Node.js 模块(这里是一个 Sass 文件) 133 | "bulma", 134 | // 项目中的 CSS 文件 135 | "@/assets/css/main.css", 136 | // 项目中的SCSS文件 137 | "@/assets/css/main.scss", 138 | ] 139 | ``` 140 | 141 | ## 开发模式 dev 142 | 143 | - **类型:** `boolean` 144 | - **默认:** `false` 145 | - **版本:2, 3** 146 | 147 | > Nuxt 是否在开发模式下运行。 148 | 149 | 通常您不需要设置这个选项。 150 | 151 | ## 目录结构 dir 152 | 153 | > 自定义 nuxt 使用的默认目录结构。 154 | 155 | 如无必要,最好保持默认值。 156 | 157 | ### 布局 `layouts` 158 | 159 | - **类型:** `string` 160 | - **默认:** `"layouts"` 161 | - **版本:2, 3** 162 | 163 | > Layouts 目录中的每个文件都将自动注册为 Nuxt 的布局。 164 | 165 | ### 页面文件夹 `pages` 166 | 167 | - **类型:** `string` 168 | - **默认:** `"pages"` 169 | - **版本:2, 3** 170 | 171 | > 此文件夹内的页面组件将会以此目录为根自动生成页面路由 172 | 173 | ### 公共文件夹`public` 174 | 175 | - **类型:** `string` 176 | - **默认:** `"public"` 177 | - **版本:3** 178 | 179 | > 包含静态文件的目录,可通过 Nuxt 服务器直接访问,并在生成应用程序时自动复制到 `dist` 文件夹中。 180 | 181 | ## 扩展 extensions 182 | 183 | - **类型:** `array` 184 | - **默认:** `[".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"]` 185 | - **版本:2, 3** 186 | 187 | > Nuxt 解析器应该解析的扩展。 188 | 189 | ## 钩子 hooks 190 | 191 | - **默认:** `null` 192 | - **版本:2, 3** 193 | 194 | > Hooks 是 Nuxt 事件的监听器,通常在模块中使用,但也可以在 `nuxt.config` 中使用。 195 | 196 | 在内部,钩子遵循使用冒号的命名模式(例如,build:done)。为了便于配置,您还可以将它们构建为 `nuxt.config` 中的分层对象(如下所示)。 197 | 198 | **示例:** 199 | 200 | ```js 201 | import fs from "fs" 202 | import path from "path" 203 | export default { 204 | hooks: { 205 | build: { 206 | done(builder) { 207 | const extraFilePath = path.join(builder.nuxt.options.buildDir, "extra-file") 208 | fs.writeFileSync(extraFilePath, "Something extra") 209 | }, 210 | }, 211 | }, 212 | } 213 | ``` 214 | 215 | ## 元信息 meta 216 | 217 | > 在每个页面上为 `` 设置默认配置。 218 | 219 | **示例:** 220 | 221 | ```js 222 | meta: { 223 | meta: [ 224 | // 225 | { name: 'viewport', content: 'width=device-width, initial-scale=1' } 226 | ], 227 | script: [ 228 | // 229 | { src: 'https://awesome-lib.js' } 230 | ], 231 | link: [ 232 | // 233 | { rel: 'stylesheet', href: 'https://awesome-lib.css' } 234 | ], 235 | // 请注意,这是一个可能会发生变化的区域 236 | style: [ 237 | // 238 | { children: ':root { color: red }', type: 'text/css' } 239 | ] 240 | } 241 | ``` 242 | 243 | ### `link` 标签 244 | 245 | - **类型:** `array` 246 | - **版本:3** 247 | 248 | ### `meta` 标签 249 | 250 | - **类型:** `array` 251 | - **版本:3** 252 | 253 | ### `script` 标签 254 | 255 | - **类型:** `array` 256 | - **版本:3** 257 | 258 | ### `style` 标签 259 | 260 | - **类型:** `array` 261 | - **版本:3** 262 | 263 | ## 模块 modules 264 | 265 | - **类型:** `array` 266 | - **版本:2,3** 267 | 268 | > 模块是 Nuxt 扩展,可以扩展其核心功能,并添加无穷的集成 269 | 270 | :::tip 模块地三种形式: 271 | 272 | - 一个 `字符串`(可以指一个包,也可以是一个文件的路径) 273 | - 以模块字符串作为第一项,以选项对象作为第二项的 `元组` 274 | - 一个 `内联模块函数` 275 | 276 | ::: 277 | ::: info 注意: 278 | 279 | - 模块按顺序执行,因此顺序很重要。 280 | - Nuxt 尝试使用 node require 路径(在 `node_modules` 中)解析 modules 数组中的每个项目。如果使用了 `~` 别名,将从项目 `srcDir` 中解析。 281 | 282 | ::: 283 | 284 | **示例:** 285 | 286 | ```js 287 | modules: [ 288 | // 使用包名 289 | "@nuxtjs/axios", 290 | // 与项目 srcDir 地相对路径 291 | "~/modules/awesome.js", 292 | // 携带配置选项 293 | ["@nuxtjs/google-analytics", { ua: "X1234567" }], 294 | // 内联函数 295 | function () {}, 296 | ] 297 | ``` 298 | 299 | ## privateRuntimeConfig 300 | 301 | - **版本:2, 3** 302 | 303 | > 运行时配置允许向 Nuxt 应用上下文传递动态配置和环境变量。 304 | 305 | `privateRuntimeConfig` 内的配置将被添加到 Nuxt 有效负载中,因此不需要重新构建来更新开发中的配置,或者如果您的应用程序由 Nuxt 服务器提供服务的话。(对于静态站点,您仍然需要重新生成站点以查看更改。) 306 | 此对象的值只能通过 `$config` 从服务器访问。它将在服务器端覆盖 `publicRuntimeConfig` 内相同内容。它应该用来保存**私有**环境变量(不应该在前端公开)。这可能包括对您的 API 秘密标记的引用。 307 | 308 | **示例:** 309 | 310 | ```js 311 | export default { 312 | privateRuntimeConfig: { 313 | apiSecret: process.env.API_SECRET, 314 | }, 315 | } 316 | ``` 317 | 318 | ## publicRuntimeConfig 319 | 320 | > 运行时配置允许向 Nuxt 应用上下文传递动态配置和环境变量。 321 | 322 | - **类型:** `object` 323 | - **版本:2, 3** 324 | - **默认:** 325 | 326 | ```json 327 | { 328 | "app": { 329 | "basePath": "/", 330 | "assetsPath": "/_nuxt/", 331 | "cdnURL": null 332 | } 333 | } 334 | ``` 335 | 336 | `publicRuntimeConfig` 内的配置将被添加到 Nuxt 有效负载中,因此不需要重新构建来更新开发中的配置,或者如果您的应用程序由 Nuxt 服务器提供服务的话。(对于静态站点,您仍然需要重新生成站点以查看更改。) 337 | 这个对象的值可以从客户端和服务器使用 `$config` 访问。 它应该保存**公共**环境变量,因为它们可以在前端访问。 这可能包括对您的公共 URL 的引用。 338 | 339 | **示例:** 340 | 341 | ```js 342 | export default { 343 | publicRuntimeConfig: { 344 | baseURL: process.env.BASE_URL || "https://nuxtjs.org", 345 | }, 346 | } 347 | ``` 348 | 349 | ## rootDir 350 | 351 | > 定义应用程序的工作区目录。 352 | 353 | - **类型:** `object` 354 | - **版本:2, 3** 355 | - **默认:** `"/project"` 356 | 357 | 此属性可以被覆盖(例如,运行 `nuxt ./my-app/` 将 rootDir 设置为 `./my-app/` 来自 当前/工作 目录。 358 | 通常不需要配置此选项。 359 | 360 | ## serverMiddleware 361 | 362 | > 服务器中间件是处理服务器端请求的 `connect/express/h3-shape` 函数。 它们在服务器上运行,并在 Vue 渲染器之前运行。 363 | 364 | - **类型:** `array` 365 | - **版本:2, 3** 366 | 367 | 通过向 `serverMiddleware` 添加条目,您可以注册额外的路由或修改 `req`/`res` 对象,而无需外部服务器。 368 | 您可以传递一个字符串,该字符串可以是节点依赖项的名称或文件路径。 您还可以传递带有 `path` 和 `handler` 字段的对象。 (`handler` 可以是路径或函数。) 369 | 370 | **示例:** 371 | 372 | ```js 373 | serverMiddleware: [ 374 | // 将注册redirect-ssl npm包 375 | "redirect-ssl", 376 | // Will register file from project server-middleware directory to handle /server-middleware/* requires 377 | // 将从项目 server-middleware 目录注册文件以处理对 /server-middleware/* 的require 378 | { path: "/server-middleware", handler: "~/server-middleware/index.js" }, 379 | // 我们也可以创建自定义实例 380 | { path: "/static2", handler: serveStatic(__dirname + "/static2") }, 381 | ] 382 | ``` 383 | 384 | :::info 注意: 385 | 如果您不希望中间件在所有路径上运行,则应该使用具有特定路径的对象表单 386 | ::: 387 | 388 | **示例:** 389 | 390 | ```js 391 | export default function (req, res, next) { 392 | // req 是 Node.js http 请求对象 393 | console.log(req.url) 394 | // res 是 Node.js http 响应对象 395 | // next 是调用下一个中间件的函数 396 | // 如果您的中间件不是最后一个,请不要忘记在最后调用 next! 397 | next() 398 | } 399 | ``` 400 | 401 | **示例:** 402 | 403 | ```js 404 | const bodyParser = require("body-parser") 405 | const app = require("express")() 406 | app.use(bodyParser.json()) 407 | app.all("/getJSON", (req, res) => { 408 | res.json({ data: "data" }) 409 | }) 410 | module.exports = app 411 | ``` 412 | 413 | **示例:** 414 | 415 | ```js 416 | export default { 417 | serverMiddleware: { 418 | "/a": "~/server-middleware/a.js", 419 | "/b": "~/server-middleware/b.js", 420 | "/c": "~/server-middleware/c.js", 421 | }, 422 | } 423 | ``` 424 | 425 | ## srcDir 426 | 427 | > 定义 Nuxt 应用程序的源文件目录。 428 | 429 | 如果指定了相对路径,它将相对于 `rootDir`。 430 | 431 | - **类型:** `string` 432 | - **版本:2, 3** 433 | - **默认:** `"/project"` 434 | 435 | **示例:** 436 | 437 | ```js 438 | export default { 439 | srcDir: "client/", 440 | } 441 | ``` 442 | 443 | 这适用于以下文件夹结构: 444 | 445 | ```bash 446 | -| app/ 447 | ---| node_modules/ 448 | ---| nuxt.config.js 449 | ---| package.json 450 | ---| client/ 451 | ------| assets/ 452 | ------| components/ 453 | ------| layouts/ 454 | ------| middleware/ 455 | ------| pages/ 456 | ------| plugins/ 457 | ------| static/ 458 | ------| store/ 459 | ``` 460 | 461 | ## ssr 462 | 463 | > 是否启用 HTML 动态渲染(在服务器模式下)或在生成时。 如果设置为 `false` 并结合 `static` 目标,生成的页面将只显示一个没有内容的加载屏幕。 464 | 465 | - **类型:** `boolean` 466 | - **版本:2, 3** 467 | - **默认:** `true` 468 | 469 | ## vite 470 | 471 | > 将直接传递给 Vite 的配置。 472 | 473 | - **版本:3** 474 | 475 | 有关更多信息,请参阅 https://vitejs.dev/config。 请注意,并非所有 vite 选项都在 Nuxt 中受支持。 476 | 477 | ## watchers 478 | 479 | > Watchers 属性允许您在 `nuxt.config` 中覆盖 watchers 配置。 480 | 481 | ### `chokidar` 482 | 483 | > 直接传递给 `chokidar` 的选项。 484 | 485 | 更多信息请查看: [chokidar](https://github.com/paulmillr/chokidar#api) 486 | 487 | #### `ignoreInitial` 488 | 489 | - **类型:** `boolean` 490 | - **版本:2, 3** 491 | - **默认:** `true` 492 | 493 | ### `rewatchOnRawEvents` 494 | 495 | > 一个事件类型数组,当接收到该事件类型时,将导致观察程序重新启动。 496 | 497 | - **版本:2, 3** 498 | 499 | ### `webpack` 500 | 501 | > `watchOptions` 直接传递给 webpack。 502 | 503 | 更多信息请查看: [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions). 504 | 505 | #### `aggregateTimeout` 506 | 507 | - **类型:** `number` 508 | - **版本:2, 3** 509 | - **默认:** `1000` 510 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@algolia/cache-browser-local-storage@4.11.0": 6 | version "4.11.0" 7 | resolved "https://registry.npmmirror.com/@algolia/cache-browser-local-storage/download/@algolia/cache-browser-local-storage-4.11.0.tgz#1c168add00b398a860db6c86039e33b2843a9425" 8 | integrity sha1-HBaK3QCzmKhg22yGA54zsoQ6lCU= 9 | dependencies: 10 | "@algolia/cache-common" "4.11.0" 11 | 12 | "@algolia/cache-common@4.11.0": 13 | version "4.11.0" 14 | resolved "https://registry.npmmirror.com/@algolia/cache-common/download/@algolia/cache-common-4.11.0.tgz#066fe6d58b18e4b028dbef9bb8de07c5e22a3594" 15 | integrity sha1-Bm/m1YsY5LAo2++buN4HxeIqNZQ= 16 | 17 | "@algolia/cache-in-memory@4.11.0": 18 | version "4.11.0" 19 | resolved "https://registry.npmmirror.com/@algolia/cache-in-memory/download/@algolia/cache-in-memory-4.11.0.tgz#763c8cb655e6fd2261588e04214fca0959ac07c1" 20 | integrity sha1-djyMtlXm/SJhWI4EIU/KCVmsB8E= 21 | dependencies: 22 | "@algolia/cache-common" "4.11.0" 23 | 24 | "@algolia/client-account@4.11.0": 25 | version "4.11.0" 26 | resolved "https://registry.npmmirror.com/@algolia/client-account/download/@algolia/client-account-4.11.0.tgz#67fadd3b0802b013ebaaa4b47bb7babae892374e" 27 | integrity sha1-Z/rdOwgCsBPrqqS0e7e6uuiSN04= 28 | dependencies: 29 | "@algolia/client-common" "4.11.0" 30 | "@algolia/client-search" "4.11.0" 31 | "@algolia/transporter" "4.11.0" 32 | 33 | "@algolia/client-analytics@4.11.0": 34 | version "4.11.0" 35 | resolved "https://registry.npmmirror.com/@algolia/client-analytics/download/@algolia/client-analytics-4.11.0.tgz#cbdc8128205e2da749cafc79e54708d14c413974" 36 | integrity sha1-y9yBKCBeLadJyvx55UcI0UxBOXQ= 37 | dependencies: 38 | "@algolia/client-common" "4.11.0" 39 | "@algolia/client-search" "4.11.0" 40 | "@algolia/requester-common" "4.11.0" 41 | "@algolia/transporter" "4.11.0" 42 | 43 | "@algolia/client-common@4.11.0": 44 | version "4.11.0" 45 | resolved "https://registry.npmmirror.com/@algolia/client-common/download/@algolia/client-common-4.11.0.tgz#9a2d1f6f8eaad25ba5d6d4ce307ba5bd84e6f999" 46 | integrity sha1-mi0fb46q0lul1tTOMHulvYTm+Zk= 47 | dependencies: 48 | "@algolia/requester-common" "4.11.0" 49 | "@algolia/transporter" "4.11.0" 50 | 51 | "@algolia/client-personalization@4.11.0": 52 | version "4.11.0" 53 | resolved "https://registry.npmmirror.com/@algolia/client-personalization/download/@algolia/client-personalization-4.11.0.tgz#d3bf0e760f85df876b4baf5b81996f0aa3a59940" 54 | integrity sha1-078Odg+F34drS69bgZlvCqOlmUA= 55 | dependencies: 56 | "@algolia/client-common" "4.11.0" 57 | "@algolia/requester-common" "4.11.0" 58 | "@algolia/transporter" "4.11.0" 59 | 60 | "@algolia/client-search@4.11.0": 61 | version "4.11.0" 62 | resolved "https://registry.npmmirror.com/@algolia/client-search/download/@algolia/client-search-4.11.0.tgz#c1105d715a2a04ba27231eca86f5d6620f68f4ae" 63 | integrity sha1-wRBdcVoqBLonIx7KhvXWYg9o9K4= 64 | dependencies: 65 | "@algolia/client-common" "4.11.0" 66 | "@algolia/requester-common" "4.11.0" 67 | "@algolia/transporter" "4.11.0" 68 | 69 | "@algolia/logger-common@4.11.0": 70 | version "4.11.0" 71 | resolved "https://registry.npmmirror.com/@algolia/logger-common/download/@algolia/logger-common-4.11.0.tgz#bac1c2d59d29dee378b57412c8edd435b97de663" 72 | integrity sha1-usHC1Z0p3uN4tXQSyO3UNbl95mM= 73 | 74 | "@algolia/logger-console@4.11.0": 75 | version "4.11.0" 76 | resolved "https://registry.npmmirror.com/@algolia/logger-console/download/@algolia/logger-console-4.11.0.tgz#ced19e3abb22eb782ed5268d51efb5aa9ef109ef" 77 | integrity sha1-ztGeOrsi63gu1SaNUe+1qp7xCe8= 78 | dependencies: 79 | "@algolia/logger-common" "4.11.0" 80 | 81 | "@algolia/requester-browser-xhr@4.11.0": 82 | version "4.11.0" 83 | resolved "https://registry.npmmirror.com/@algolia/requester-browser-xhr/download/@algolia/requester-browser-xhr-4.11.0.tgz#f9e1ad56f185432aa8dde8cad53ae271fd5d6181" 84 | integrity sha1-+eGtVvGFQyqo3ejK1Tricf1dYYE= 85 | dependencies: 86 | "@algolia/requester-common" "4.11.0" 87 | 88 | "@algolia/requester-common@4.11.0": 89 | version "4.11.0" 90 | resolved "https://registry.npmmirror.com/@algolia/requester-common/download/@algolia/requester-common-4.11.0.tgz#d16de98d3ff72434bac39e4d915eab08035946a9" 91 | integrity sha1-0W3pjT/3JDS6w55NkV6rCANZRqk= 92 | 93 | "@algolia/requester-node-http@4.11.0": 94 | version "4.11.0" 95 | resolved "https://registry.npmmirror.com/@algolia/requester-node-http/download/@algolia/requester-node-http-4.11.0.tgz#beb2b6b68d5f4ce15aec80ede623f0ac96991368" 96 | integrity sha1-vrK2to1fTOFa7IDt5iPwrJaZE2g= 97 | dependencies: 98 | "@algolia/requester-common" "4.11.0" 99 | 100 | "@algolia/transporter@4.11.0": 101 | version "4.11.0" 102 | resolved "https://registry.npmmirror.com/@algolia/transporter/download/@algolia/transporter-4.11.0.tgz#a8de3c173093ceceb02b26b577395ce3b3d4b96f" 103 | integrity sha1-qN48FzCTzs6wKya1dzlc47PUuW8= 104 | dependencies: 105 | "@algolia/cache-common" "4.11.0" 106 | "@algolia/logger-common" "4.11.0" 107 | "@algolia/requester-common" "4.11.0" 108 | 109 | "@babel/parser@^7.15.0": 110 | version "7.16.4" 111 | resolved "https://registry.npmmirror.com/@babel/parser/download/@babel/parser-7.16.4.tgz?cache=0&sync_timestamp=1637102886037&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2F%40babel%2Fparser%2Fdownload%2F%40babel%2Fparser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" 112 | integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== 113 | 114 | "@docsearch/css@^1.0.0-alpha.28": 115 | version "1.0.0-alpha.28" 116 | resolved "https://registry.npmmirror.com/@docsearch/css/download/@docsearch/css-1.0.0-alpha.28.tgz#c8a2cd8c1bb3a6855c51892e9dbdab5d42fe6e23" 117 | integrity sha1-yKLNjBuzpoVcUYkunb2rXUL+biM= 118 | 119 | "@docsearch/js@^1.0.0-alpha.28": 120 | version "1.0.0-alpha.28" 121 | resolved "https://registry.npmmirror.com/@docsearch/js/download/@docsearch/js-1.0.0-alpha.28.tgz#f0fde7b8a6b1e1d8a7ae1e7655c43d959b457b2b" 122 | integrity sha1-8P3nuKax4dinrh52VcQ9lZtFeys= 123 | dependencies: 124 | "@docsearch/react" "^1.0.0-alpha.28" 125 | preact "^10.0.0" 126 | 127 | "@docsearch/react@^1.0.0-alpha.28": 128 | version "1.0.0-alpha.28" 129 | resolved "https://registry.npmmirror.com/@docsearch/react/download/@docsearch/react-1.0.0-alpha.28.tgz#4f039ed79f8b3332b19a57677b219aebc5010e9d" 130 | integrity sha1-TwOe15+LMzKxmldneyGa68UBDp0= 131 | dependencies: 132 | "@docsearch/css" "^1.0.0-alpha.28" 133 | "@francoischalifour/autocomplete-core" "^1.0.0-alpha.28" 134 | "@francoischalifour/autocomplete-preset-algolia" "^1.0.0-alpha.28" 135 | algoliasearch "^4.0.0" 136 | 137 | "@francoischalifour/autocomplete-core@^1.0.0-alpha.28": 138 | version "1.0.0-alpha.28" 139 | resolved "https://registry.npm.taobao.org/@francoischalifour/autocomplete-core/download/@francoischalifour/autocomplete-core-1.0.0-alpha.28.tgz#6b9d8491288e77f831e9b345d461623b0d3f5005" 140 | integrity sha1-a52EkSiOd/gx6bNF1GFiOw0/UAU= 141 | 142 | "@francoischalifour/autocomplete-preset-algolia@^1.0.0-alpha.28": 143 | version "1.0.0-alpha.28" 144 | resolved "https://registry.npm.taobao.org/@francoischalifour/autocomplete-preset-algolia/download/@francoischalifour/autocomplete-preset-algolia-1.0.0-alpha.28.tgz#a5ad7996f42e43e4acbb4e0010d663746d0e9997" 145 | integrity sha1-pa15lvQuQ+Ssu04AENZjdG0OmZc= 146 | 147 | "@vitejs/plugin-vue@^1.9.0": 148 | version "1.10.1" 149 | resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/download/@vitejs/plugin-vue-1.10.1.tgz#d140e93d574c5eac247a79f5b15df665dcb7635b" 150 | integrity sha512-oL76QETMSpVE9jIScirGB2bYJEVU/+r+g+K7oG+sXPs9TZljqveoVRsmLyXlMZTjpQkLL8gz527cW80NMGVKJg== 151 | 152 | "@vue/compiler-core@3.2.23": 153 | version "3.2.23" 154 | resolved "https://registry.npmmirror.com/@vue/compiler-core/download/@vue/compiler-core-3.2.23.tgz#ef1769fbf313306b47c858735a9300aa2a20f104" 155 | integrity sha512-4ZhiI/orx+7EJ1B+0zjgvXMV2uRN+XBfG06UN2sJfND9rH5gtEQT3QmO4erum1o6Irl7y754W8/KSaDJh4EUQg== 156 | dependencies: 157 | "@babel/parser" "^7.15.0" 158 | "@vue/shared" "3.2.23" 159 | estree-walker "^2.0.2" 160 | source-map "^0.6.1" 161 | 162 | "@vue/compiler-dom@3.2.23": 163 | version "3.2.23" 164 | resolved "https://registry.npmmirror.com/@vue/compiler-dom/download/@vue/compiler-dom-3.2.23.tgz#1dc5ba6c61f4d9e5e22442bfbf1ca306bb698507" 165 | integrity sha512-X2Nw8QFc5lgoK3kio5ktM95nqmLUH+q+N/PbV4kCHzF1avqv/EGLnAhaaF0Iu4bewNvHJAAhhwPZFeoV/22nbw== 166 | dependencies: 167 | "@vue/compiler-core" "3.2.23" 168 | "@vue/shared" "3.2.23" 169 | 170 | "@vue/compiler-sfc@3.2.23": 171 | version "3.2.23" 172 | resolved "https://registry.npmmirror.com/@vue/compiler-sfc/download/@vue/compiler-sfc-3.2.23.tgz#35ef678240b29da5144bc3c6447fa51a07d78875" 173 | integrity sha512-Aw+pb50Q5zTjyvWod8mNKmYZDRGHJBptmNNWE+84ZxrzEztPgMz8cNYIzWGbwcFVkmJlhvioAMvKnB+LM/sjSA== 174 | dependencies: 175 | "@babel/parser" "^7.15.0" 176 | "@vue/compiler-core" "3.2.23" 177 | "@vue/compiler-dom" "3.2.23" 178 | "@vue/compiler-ssr" "3.2.23" 179 | "@vue/ref-transform" "3.2.23" 180 | "@vue/shared" "3.2.23" 181 | estree-walker "^2.0.2" 182 | magic-string "^0.25.7" 183 | postcss "^8.1.10" 184 | source-map "^0.6.1" 185 | 186 | "@vue/compiler-ssr@3.2.23": 187 | version "3.2.23" 188 | resolved "https://registry.npmmirror.com/@vue/compiler-ssr/download/@vue/compiler-ssr-3.2.23.tgz#cd9c6541c388553f6448244a9f2a76dfdba027ba" 189 | integrity sha512-Bqzn4jFyXPK1Ehqiq7e/czS8n62gtYF1Zfeu0DrR5uv+SBllh7LIvZjZU6+c8qbocAd3/T3I3gn2cZGmnDb6zg== 190 | dependencies: 191 | "@vue/compiler-dom" "3.2.23" 192 | "@vue/shared" "3.2.23" 193 | 194 | "@vue/reactivity@3.2.23": 195 | version "3.2.23" 196 | resolved "https://registry.npmmirror.com/@vue/reactivity/download/@vue/reactivity-3.2.23.tgz#d2f10749d554f7e94d8d52f36e7e6a0b021a2418" 197 | integrity sha512-8RGVr/5Kpgb/EkCjgHXqttgA5IMc6n0lIXFY4TVbMkzdXrvaIhzBd7Te44oIDsTSYVKZLpfHd6/wEnuDqE8vFw== 198 | dependencies: 199 | "@vue/shared" "3.2.23" 200 | 201 | "@vue/ref-transform@3.2.23": 202 | version "3.2.23" 203 | resolved "https://registry.npmmirror.com/@vue/ref-transform/download/@vue/ref-transform-3.2.23.tgz#5c8b0c0638db27094ddd689020c60cf1aa33d873" 204 | integrity sha512-gW0GD2PSAs/th7mC7tPB/UwpIQxclbApVtsDtscDmOJXb2+cdu60ny+SuHNgfrlUT/JqWKQHq7jFKO4woxLNaA== 205 | dependencies: 206 | "@babel/parser" "^7.15.0" 207 | "@vue/compiler-core" "3.2.23" 208 | "@vue/shared" "3.2.23" 209 | estree-walker "^2.0.2" 210 | magic-string "^0.25.7" 211 | 212 | "@vue/runtime-core@3.2.23": 213 | version "3.2.23" 214 | resolved "https://registry.npmmirror.com/@vue/runtime-core/download/@vue/runtime-core-3.2.23.tgz#f620ce0142e87cbc99c50ac285e644ed9b57986f" 215 | integrity sha512-wSI5lmY2kCGLf89iiygqxVh6/5bsawz78Me9n1x4U2bHnN0yf3PWyuhN0WgIE8VfEaF7e75E333uboNEIFjgkg== 216 | dependencies: 217 | "@vue/reactivity" "3.2.23" 218 | "@vue/shared" "3.2.23" 219 | 220 | "@vue/runtime-dom@3.2.23": 221 | version "3.2.23" 222 | resolved "https://registry.npmmirror.com/@vue/runtime-dom/download/@vue/runtime-dom-3.2.23.tgz#e6a3362a8a03f034ef6ff9b8281b166f0f314bfc" 223 | integrity sha512-z6lp0888NkLmxD9j2sGoll8Kb7J743s8s6w7GbiyUc4WZwm0KJ35B4qTFDMoIU0G7CatS6Z+yRTpPHc6srtByg== 224 | dependencies: 225 | "@vue/runtime-core" "3.2.23" 226 | "@vue/shared" "3.2.23" 227 | csstype "^2.6.8" 228 | 229 | "@vue/server-renderer@3.2.23": 230 | version "3.2.23" 231 | resolved "https://registry.npmmirror.com/@vue/server-renderer/download/@vue/server-renderer-3.2.23.tgz#c7e22c02d8a518bd2499565b7c7c88b1842edd44" 232 | integrity sha512-mgQ2VAE5WjeZELJKNbwE69uiBNpN+3LyL0ZDki1bJWVwHD2fhPfx7pwyYuiucE81xz2LxVsyGxhKKUL997g8vw== 233 | dependencies: 234 | "@vue/compiler-ssr" "3.2.23" 235 | "@vue/shared" "3.2.23" 236 | 237 | "@vue/shared@3.2.23": 238 | version "3.2.23" 239 | resolved "https://registry.npmmirror.com/@vue/shared/download/@vue/shared-3.2.23.tgz#e885a2ba099d40b69d5461157f3ade31e46a09a9" 240 | integrity sha512-U+/Jefa0QfXUF2qVy9Dqlrb6HKJSr9/wJcM66wXmWcTOoqg7hOWzF4qruDle51pyF4x3wMn6TSH54UdjKjCKMA== 241 | 242 | algoliasearch@^4.0.0: 243 | version "4.11.0" 244 | resolved "https://registry.npmmirror.com/algoliasearch/download/algoliasearch-4.11.0.tgz#234befb3ac355c094077f0edf3777240b1ee013c" 245 | integrity sha1-I0vvs6w1XAlAd/Dt83dyQLHuATw= 246 | dependencies: 247 | "@algolia/cache-browser-local-storage" "4.11.0" 248 | "@algolia/cache-common" "4.11.0" 249 | "@algolia/cache-in-memory" "4.11.0" 250 | "@algolia/client-account" "4.11.0" 251 | "@algolia/client-analytics" "4.11.0" 252 | "@algolia/client-common" "4.11.0" 253 | "@algolia/client-personalization" "4.11.0" 254 | "@algolia/client-search" "4.11.0" 255 | "@algolia/logger-common" "4.11.0" 256 | "@algolia/logger-console" "4.11.0" 257 | "@algolia/requester-browser-xhr" "4.11.0" 258 | "@algolia/requester-common" "4.11.0" 259 | "@algolia/requester-node-http" "4.11.0" 260 | "@algolia/transporter" "4.11.0" 261 | 262 | csstype@^2.6.8: 263 | version "2.6.19" 264 | resolved "https://registry.npmmirror.com/csstype/download/csstype-2.6.19.tgz?cache=0&sync_timestamp=1637224507298&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcsstype%2Fdownload%2Fcsstype-2.6.19.tgz#feeb5aae89020bb389e1f63669a5ed490e391caa" 265 | integrity sha512-ZVxXaNy28/k3kJg0Fou5MiYpp88j7H9hLZp8PDC3jV0WFjfH5E9xHb56L0W59cPbKbcHXeP4qyT8PrHp8t6LcQ== 266 | 267 | esbuild-android-arm64@0.13.15: 268 | version "0.13.15" 269 | resolved "https://registry.npmmirror.com/esbuild-android-arm64/download/esbuild-android-arm64-0.13.15.tgz#3fc3ff0bab76fe35dd237476b5d2b32bb20a3d44" 270 | integrity sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg== 271 | 272 | esbuild-darwin-64@0.13.15: 273 | version "0.13.15" 274 | resolved "https://registry.npmmirror.com/esbuild-darwin-64/download/esbuild-darwin-64-0.13.15.tgz#8e9169c16baf444eacec60d09b24d11b255a8e72" 275 | integrity sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ== 276 | 277 | esbuild-darwin-arm64@0.13.15: 278 | version "0.13.15" 279 | resolved "https://registry.npmmirror.com/esbuild-darwin-arm64/download/esbuild-darwin-arm64-0.13.15.tgz#1b07f893b632114f805e188ddfca41b2b778229a" 280 | integrity sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ== 281 | 282 | esbuild-freebsd-64@0.13.15: 283 | version "0.13.15" 284 | resolved "https://registry.npmmirror.com/esbuild-freebsd-64/download/esbuild-freebsd-64-0.13.15.tgz#0b8b7eca1690c8ec94c75680c38c07269c1f4a85" 285 | integrity sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA== 286 | 287 | esbuild-freebsd-arm64@0.13.15: 288 | version "0.13.15" 289 | resolved "https://registry.npmmirror.com/esbuild-freebsd-arm64/download/esbuild-freebsd-arm64-0.13.15.tgz#2e1a6c696bfdcd20a99578b76350b41db1934e52" 290 | integrity sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ== 291 | 292 | esbuild-linux-32@0.13.15: 293 | version "0.13.15" 294 | resolved "https://registry.npmmirror.com/esbuild-linux-32/download/esbuild-linux-32-0.13.15.tgz#6fd39f36fc66dd45b6b5f515728c7bbebc342a69" 295 | integrity sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g== 296 | 297 | esbuild-linux-64@0.13.15: 298 | version "0.13.15" 299 | resolved "https://registry.npmmirror.com/esbuild-linux-64/download/esbuild-linux-64-0.13.15.tgz#9cb8e4bcd7574e67946e4ee5f1f1e12386bb6dd3" 300 | integrity sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA== 301 | 302 | esbuild-linux-arm64@0.13.15: 303 | version "0.13.15" 304 | resolved "https://registry.npmmirror.com/esbuild-linux-arm64/download/esbuild-linux-arm64-0.13.15.tgz#3891aa3704ec579a1b92d2a586122e5b6a2bfba1" 305 | integrity sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA== 306 | 307 | esbuild-linux-arm@0.13.15: 308 | version "0.13.15" 309 | resolved "https://registry.npmmirror.com/esbuild-linux-arm/download/esbuild-linux-arm-0.13.15.tgz#8a00e99e6a0c6c9a6b7f334841364d8a2b4aecfe" 310 | integrity sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA== 311 | 312 | esbuild-linux-mips64le@0.13.15: 313 | version "0.13.15" 314 | resolved "https://registry.npmmirror.com/esbuild-linux-mips64le/download/esbuild-linux-mips64le-0.13.15.tgz#36b07cc47c3d21e48db3bb1f4d9ef8f46aead4f7" 315 | integrity sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg== 316 | 317 | esbuild-linux-ppc64le@0.13.15: 318 | version "0.13.15" 319 | resolved "https://registry.npmmirror.com/esbuild-linux-ppc64le/download/esbuild-linux-ppc64le-0.13.15.tgz#f7e6bba40b9a11eb9dcae5b01550ea04670edad2" 320 | integrity sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ== 321 | 322 | esbuild-netbsd-64@0.13.15: 323 | version "0.13.15" 324 | resolved "https://registry.npmmirror.com/esbuild-netbsd-64/download/esbuild-netbsd-64-0.13.15.tgz#a2fedc549c2b629d580a732d840712b08d440038" 325 | integrity sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w== 326 | 327 | esbuild-openbsd-64@0.13.15: 328 | version "0.13.15" 329 | resolved "https://registry.npmmirror.com/esbuild-openbsd-64/download/esbuild-openbsd-64-0.13.15.tgz#b22c0e5806d3a1fbf0325872037f885306b05cd7" 330 | integrity sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g== 331 | 332 | esbuild-sunos-64@0.13.15: 333 | version "0.13.15" 334 | resolved "https://registry.npmmirror.com/esbuild-sunos-64/download/esbuild-sunos-64-0.13.15.tgz#d0b6454a88375ee8d3964daeff55c85c91c7cef4" 335 | integrity sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw== 336 | 337 | esbuild-windows-32@0.13.15: 338 | version "0.13.15" 339 | resolved "https://registry.npmmirror.com/esbuild-windows-32/download/esbuild-windows-32-0.13.15.tgz#c96d0b9bbb52f3303322582ef8e4847c5ad375a7" 340 | integrity sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw== 341 | 342 | esbuild-windows-64@0.13.15: 343 | version "0.13.15" 344 | resolved "https://registry.npmmirror.com/esbuild-windows-64/download/esbuild-windows-64-0.13.15.tgz#1f79cb9b1e1bb02fb25cd414cb90d4ea2892c294" 345 | integrity sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ== 346 | 347 | esbuild-windows-arm64@0.13.15: 348 | version "0.13.15" 349 | resolved "https://registry.npmmirror.com/esbuild-windows-arm64/download/esbuild-windows-arm64-0.13.15.tgz#482173070810df22a752c686509c370c3be3b3c3" 350 | integrity sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA== 351 | 352 | esbuild@^0.13.2: 353 | version "0.13.15" 354 | resolved "https://registry.npmmirror.com/esbuild/download/esbuild-0.13.15.tgz#db56a88166ee373f87dbb2d8798ff449e0450cdf" 355 | integrity sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw== 356 | optionalDependencies: 357 | esbuild-android-arm64 "0.13.15" 358 | esbuild-darwin-64 "0.13.15" 359 | esbuild-darwin-arm64 "0.13.15" 360 | esbuild-freebsd-64 "0.13.15" 361 | esbuild-freebsd-arm64 "0.13.15" 362 | esbuild-linux-32 "0.13.15" 363 | esbuild-linux-64 "0.13.15" 364 | esbuild-linux-arm "0.13.15" 365 | esbuild-linux-arm64 "0.13.15" 366 | esbuild-linux-mips64le "0.13.15" 367 | esbuild-linux-ppc64le "0.13.15" 368 | esbuild-netbsd-64 "0.13.15" 369 | esbuild-openbsd-64 "0.13.15" 370 | esbuild-sunos-64 "0.13.15" 371 | esbuild-windows-32 "0.13.15" 372 | esbuild-windows-64 "0.13.15" 373 | esbuild-windows-arm64 "0.13.15" 374 | 375 | estree-walker@^2.0.2: 376 | version "2.0.2" 377 | resolved "https://registry.npm.taobao.org/estree-walker/download/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" 378 | integrity sha1-UvAQF4wqTBF6d1fP6UKtt9LaTKw= 379 | 380 | fsevents@~2.3.2: 381 | version "2.3.2" 382 | resolved "https://registry.npmmirror.com/fsevents/download/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 383 | integrity sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro= 384 | 385 | function-bind@^1.1.1: 386 | version "1.1.1" 387 | resolved "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 388 | integrity sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0= 389 | 390 | has@^1.0.3: 391 | version "1.0.3" 392 | resolved "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" 393 | integrity sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y= 394 | dependencies: 395 | function-bind "^1.1.1" 396 | 397 | is-core-module@^2.2.0: 398 | version "2.8.0" 399 | resolved "https://registry.npmmirror.com/is-core-module/download/is-core-module-2.8.0.tgz?cache=0&sync_timestamp=1634237061095&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fis-core-module%2Fdownload%2Fis-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" 400 | integrity sha1-AyEzbD0JJeSX/Zf12VyxFKXM1Ug= 401 | dependencies: 402 | has "^1.0.3" 403 | 404 | magic-string@^0.25.7: 405 | version "0.25.7" 406 | resolved "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" 407 | integrity sha1-P0l9b9NMZpxnmNy4IfLvMfVEUFE= 408 | dependencies: 409 | sourcemap-codec "^1.4.4" 410 | 411 | nanoid@^3.1.30: 412 | version "3.1.30" 413 | resolved "https://registry.npmmirror.com/nanoid/download/nanoid-3.1.30.tgz?cache=0&sync_timestamp=1634166241996&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fnanoid%2Fdownload%2Fnanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" 414 | integrity sha1-Y/k8xUjSoRPcXfvGO/oJ4rm2Q2I= 415 | 416 | path-parse@^1.0.6: 417 | version "1.0.7" 418 | resolved "https://registry.nlark.com/path-parse/download/path-parse-1.0.7.tgz?cache=0&sync_timestamp=1621947783503&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpath-parse%2Fdownload%2Fpath-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" 419 | integrity sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU= 420 | 421 | picocolors@^1.0.0: 422 | version "1.0.0" 423 | resolved "https://registry.npmmirror.com/picocolors/download/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" 424 | integrity sha1-y1vcdP8/UYkiNur3nWi8RFZKuBw= 425 | 426 | postcss@^8.1.10, postcss@^8.3.8: 427 | version "8.4.4" 428 | resolved "https://registry.npmmirror.com/postcss/download/postcss-8.4.4.tgz#d53d4ec6a75fd62557a66bb41978bf47ff0c2869" 429 | integrity sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q== 430 | dependencies: 431 | nanoid "^3.1.30" 432 | picocolors "^1.0.0" 433 | source-map-js "^1.0.1" 434 | 435 | preact@^10.0.0: 436 | version "10.6.2" 437 | resolved "https://registry.npmmirror.com/preact/download/preact-10.6.2.tgz#c849f91df9ad36bfa64d1a5d5880977f767c69e5" 438 | integrity sha512-ppDjurt75nSxyikpyali+uKwRl8CK9N6ntOPovGIEGQagjMLVzEgVqFEsUUyUrqyE9Ch90KE0jmFc9q2QcPLBA== 439 | 440 | prismjs@^1.25.0: 441 | version "1.25.0" 442 | resolved "https://registry.nlark.com/prismjs/download/prismjs-1.25.0.tgz#6f822df1bdad965734b310b315a23315cf999756" 443 | integrity sha1-b4It8b2tllc0sxCzFaIzFc+Zl1Y= 444 | 445 | resolve@^1.20.0: 446 | version "1.20.0" 447 | resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" 448 | integrity sha1-YpoBP7P3B1XW8LeTXMHCxTeLGXU= 449 | dependencies: 450 | is-core-module "^2.2.0" 451 | path-parse "^1.0.6" 452 | 453 | rollup@^2.57.0: 454 | version "2.60.2" 455 | resolved "https://registry.npmmirror.com/rollup/download/rollup-2.60.2.tgz#3f45ace36a9b10b4297181831ea0719922513463" 456 | integrity sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw== 457 | optionalDependencies: 458 | fsevents "~2.3.2" 459 | 460 | source-map-js@^1.0.1: 461 | version "1.0.1" 462 | resolved "https://registry.npmmirror.com/source-map-js/download/source-map-js-1.0.1.tgz?cache=0&sync_timestamp=1636401089874&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fsource-map-js%2Fdownload%2Fsource-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" 463 | integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== 464 | 465 | source-map@^0.6.1: 466 | version "0.6.1" 467 | resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 468 | integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM= 469 | 470 | sourcemap-codec@^1.4.4: 471 | version "1.4.8" 472 | resolved "https://registry.nlark.com/sourcemap-codec/download/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" 473 | integrity sha1-6oBL2UhXQC5pktBaOO8a41qatMQ= 474 | 475 | vite@^2.6.5: 476 | version "2.6.14" 477 | resolved "https://registry.npmmirror.com/vite/download/vite-2.6.14.tgz#35c09a15e4df823410819a2a239ab11efb186271" 478 | integrity sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA== 479 | dependencies: 480 | esbuild "^0.13.2" 481 | postcss "^8.3.8" 482 | resolve "^1.20.0" 483 | rollup "^2.57.0" 484 | optionalDependencies: 485 | fsevents "~2.3.2" 486 | 487 | vitepress@^0.20.1: 488 | version "0.20.1" 489 | resolved "https://registry.npmmirror.com/vitepress/download/vitepress-0.20.1.tgz?cache=0&sync_timestamp=1636076162462&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fvitepress%2Fdownload%2Fvitepress-0.20.1.tgz#34d39950a5062a4efa5621be3a78c005f656faee" 490 | integrity sha1-NNOZUKUGKk76ViG+OnjABfZW+u4= 491 | dependencies: 492 | "@docsearch/css" "^1.0.0-alpha.28" 493 | "@docsearch/js" "^1.0.0-alpha.28" 494 | "@vitejs/plugin-vue" "^1.9.0" 495 | prismjs "^1.25.0" 496 | vite "^2.6.5" 497 | vue "^3.2.19" 498 | 499 | vue@^3.2.19: 500 | version "3.2.23" 501 | resolved "https://registry.npmmirror.com/vue/download/vue-3.2.23.tgz#fe17e4a98bee1afe2aed351a0a80e052728f9ce2" 502 | integrity sha512-MGp9JZC37lzGhwSu6c1tQxrQbXbw7XKFqtYh7SFwNrNK899FPxGAHwSHMZijMChTSC3uZrD2BGO/3EHOgMJ0cw== 503 | dependencies: 504 | "@vue/compiler-dom" "3.2.23" 505 | "@vue/compiler-sfc" "3.2.23" 506 | "@vue/runtime-dom" "3.2.23" 507 | "@vue/server-renderer" "3.2.23" 508 | "@vue/shared" "3.2.23" 509 | --------------------------------------------------------------------------------