docs: typos and wording tweaks for guide section (#24323)

This commit is contained in:
Joe Hawes 2023-11-16 06:23:59 -08:00 committed by GitHub
parent e95026f5bb
commit c9b7dcfc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 10 deletions

View File

@ -25,7 +25,7 @@ We chose to build Nuxt on top of Vue for these reasons:
### Auto-imports
Every Vue component created in the [`components/`](/docs/guide/directory-structure/components) directoryof a Nuxt project will be available in your project without having to import it. If a component is not used anywhere, your productions code will not include it.
Every Vue component created in the [`components/`](/docs/guide/directory-structure/components) directory of a Nuxt project will be available in your project without having to import it. If a component is not used anywhere, your productions code will not include it.
:read-more{to="/docs/guide/concepts/auto-imports"}

View File

@ -38,7 +38,7 @@ However, there are some key differences with actual spec; here's [a helpful expl
You may have been writing your app using ESM syntax for a long time. After all, it's natively supported by the browser, and in Nuxt 2 we compiled all the code you wrote to the appropriate format (CJS for server, ESM for browser).
When using modules you'd install into your package, things were a little different. A sample library might expose both CJS and ESM versions, and let us pick which one we wanted:
When adding modules to your package, things were a little different. A sample library might expose both CJS and ESM versions, and let us pick which one we wanted:
```json
{

View File

@ -415,7 +415,7 @@ You can specify a `fallbackTag` to make it render a specific tag if it fails to
## Library Authors
Making Vue component libraries with automatic tree-shaking and component registration is super easy ✨
Making Vue component libraries with automatic tree-shaking and component registration is super easy.
You can use the `components:dirs` hook to extend the directory list without requiring user configuration in your Nuxt module.

View File

@ -9,7 +9,7 @@ Nuxt provides a customizable **route middleware** framework you can use througho
There are three kinds of route middleware:
1. Anonymous (or inline) route middleware are defined directly within the page
1. Anonymous (or inline) route middleware are defined directly within the page.
2. Named route middleware, placed in the `middleware/` and automatically loaded via asynchronous import when used on a page.
3. Global route middleware, placed in the `middleware/` with a `.global` suffix and is run on every route change.
@ -157,7 +157,7 @@ export default defineNuxtPlugin(() => {
---| auth.ts
```
In your page file, you can reference this route middleware
In your page file, you can reference this route middleware:
```vue
<script setup lang="ts">

View File

@ -1,6 +1,6 @@
---
title: "pages"
description: "Nuxt provides a file-based routing to create routes within your web application."
description: "Nuxt provides file-based routing to create routes within your web application."
head.title: "pages/"
navigation.icon: i-ph-folder-duotone
---
@ -336,7 +336,9 @@ Learn more about `<NuxtLink>` usage.
Nuxt 3 allows programmatic navigation through the `navigateTo()` utility method. Using this utility method, you will be able to programmatically navigate the user in your app. This is great for taking input from the user and navigating them dynamically throughout your application. In this example, we have a simple method called `navigate()` that gets called when the user submits a search form.
**Note:** Ensure to always `await` on `navigateTo` or chain its result by returning from functions.
::callout{color="blue" icon="i-ph-info-duotone"}
Ensure to always `await` on `navigateTo` or chain its result by returning from functions.
::
```vue
<script setup lang="ts">

View File

@ -5,7 +5,7 @@ head.title: "public/"
navigation.icon: i-ph-folder-duotone
---
The `public/` is served at the server root and contains public files that have to keep their names (e.g. `robots.txt`) _or_ likely won't change (e.g. `favicon.ico`).
Files contained within the `public/` directory are served at the root and are not modified by the build process. This is suitable for files that have to keep their names (e.g. `robots.txt`) _or_ likely won't change (e.g. `favicon.ico`).
```bash [Directory structure]
-| public/

View File

@ -5,7 +5,7 @@ description: The server/ directory is used to register API and server handlers t
navigation.icon: i-ph-folder-duotone
---
Nuxt automatically scans files inside these directories to register API and server handlers with HMR support.
Nuxt automatically scans files inside these directories to register API and server handlers with Hot Module Replacement (HMR) support.
```bash [Directory structure]
-| server/
@ -142,7 +142,7 @@ To improve clarity within your IDE between the auto-imports from 'nitro' and 'vu
}
```
Although right now these values won't be respected when type checking ([`nuxi typecheck`](/docs/api/commands/typecheck)), you should get better type hints in your IDE.
Currently, these values won't be respected when type checking ([`nuxi typecheck`](/docs/api/commands/typecheck)), but you should get better type hints in your IDE.
## Recipes