Skip to content
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

feat(docs) Перевод Nitro #158

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# Upload the results as artifacts (опциональный). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
Expand Down
2 changes: 1 addition & 1 deletion docs/1.getting-started/11.testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We currently ship an environment for unit testing code that needs a [Nuxt](https

### Настройка

1. Add `@nuxt/test-utils/module` to your `nuxt.config` file (optional). It adds a Vitest integration to your Nuxt DevTools which supports running your unit tests in development.
1. Add `@nuxt/test-utils/module` to your `nuxt.config` file (опциональный). It adds a Vitest integration to your Nuxt DevTools which supports running your unit tests in development.

```ts twoslash
export default defineNuxtConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/1.getting-started/5.seo-meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const title = ref('Привет, мир!')
</template>
```

## Типы
## Типы {#types}

Ниже приведены нереактивные типы, используемые для [`useHead`](/docs/api/composables/use-head), [`app.head`](/docs/api/nuxt-config#head) и компонентов.
```ts
Expand Down
6 changes: 3 additions & 3 deletions docs/1.getting-started/6.data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ watch(() => route.path, (path) => {
</script>
```

#### Наблюдение
#### Наблюдение {#watch}

Чтобы повторно запускать функцию получения данных при каждом изменении других реактивных значений в вашем приложении, используйте опцию `watch`. Вы можете использовать ее для одного или нескольких _наблюдаемых_ элементов.

Expand Down Expand Up @@ -347,7 +347,7 @@ const { data, error, refresh } = await useFetch(`/api/users/${id.value}`, {

Если вам нужно изменить URL на основе реактивного значения, вместо него лучше использовать [вычисляемый URL](#computed-url).

#### Вычисляемый URL
#### Вычисляемый URL {#computed-url}

Иногда вам может потребоваться вычислить URL из реактивных значений и обновлять данные каждый раз, когда они меняются. Вместо того чтобы жонглировать данными, вы можете прикрепить каждый параметр как реактивное значение. Nuxt будет автоматически использовать реактивное значение и обновлять данные при каждом его изменении.

Expand Down Expand Up @@ -398,7 +398,7 @@ const { data, pending, status } = useLazyFetch(() => `/api/users/${id.value}`, {

Если вам нужно принудительно обновлять данные при изменении других реактивных значений, вы также можете [следить за другими значениями](#watch).

### Не срочно
### Не срочно {#not-immediate}

Композабл `useFetch` начнет получать данные в момент вызова. Вы можете предотвратить это, установив `immediate: false`, например, чтобы дождаться взаимодействия с пользователем.

Expand Down
4 changes: 2 additions & 2 deletions docs/2.guide/3.going-further/3.modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,14 @@ export default defineNuxtModule({
// From the runtime directory
addComponent({
name: 'MySuperComponent', // name of the component to be used in vue templates
export: 'MySuperComponent', // (optional) if the component is a named (rather than default) export
export: 'MySuperComponent', // (опциональный) if the component is a named (rather than default) export
filePath: resolver.resolve('runtime/components/MySuperComponent.vue')
})

// From a library
addComponent({
name: 'MyAwesomeComponent', // name of the component to be used in vue templates
export: 'MyAwesomeComponent', // (optional) if the component is a named (rather than default) export
export: 'MyAwesomeComponent', // (опциональный) if the component is a named (rather than default) export
filePath: '@vue/awesome-components'
})
}
Expand Down
2 changes: 1 addition & 1 deletion docs/3.api/1.components/4.nuxt-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ links:
Значения по умолчанию могут быть перезаписаны, см. раздел [перезапись значений по умолчанию](#overwriting-defaults), если вы хотите их изменить.
::

## Перезапись значений по умолчанию
## Перезапись значений по умолчанию {#overwriting-defaults}

### В Nuxt Config

Expand Down
2 changes: 1 addition & 1 deletion docs/3.api/3.utils/define-page-meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ definePageMeta({
</script>
```

### Использование пользовательского регулярного выражения
### Использование пользовательского регулярного выражения {#using-a-custom-regular-expression}

Пользовательское регулярное выражение является хорошим способом разрешения конфликтов между пересекающимися маршрутами, например:

Expand Down
4 changes: 2 additions & 2 deletions docs/3.api/5.kit/1.modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface ModuleMeta {

**Тип**: `ModuleDefinition<T> | NuxtModule<T>`

**Обязательно**: `true`
**Обязательный**: `true`

Объект определения модуля или функция модуля.

Expand Down Expand Up @@ -129,7 +129,7 @@ async function installModule (moduleToInstall: string | NuxtModule, inlineOption

**Тип**: `string` | `NuxtModule`

**Обязательно**: `true`
**Обязательный**: `true`

Модуль для установки. Может быть либо строкой с именем модуля, либо самим объектом модуля.

Expand Down
28 changes: 14 additions & 14 deletions docs/3.api/5.kit/10.templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,41 @@ interface ResolvedNuxtTemplate {

**Тип**: `NuxtTemplate | string`

**Обязательно**: `true`
**Обязательный**: `true`

A template object or a string with the path to the template. If a string is provided, it will be converted to a template object with `src` set to the string value. If a template object is provided, it must have the following properties:

- `src` (optional)
- `src` (опциональный)

**Тип**: `string`

Path to the template. If `src` is not provided, `getContents` must be provided instead.

- `filename` (optional)
- `filename` (опциональный)

**Тип**: `string`

Filename of the template. If `filename` is not provided, it will be generated from the `src` path. In this case, the `src` option is required.

- `dst` (optional)
- `dst` (опциональный)

**Тип**: `string`

Path to the destination file. If `dst` is not provided, it will be generated from the `filename` path and nuxt `buildDir` option.

- `options` (optional)
- `options` (опциональный)

**Тип**: `Options`

Options to pass to the template.

- `getContents` (optional)
- `getContents` (опциональный)

**Тип**: `(data: Options) => string | Promise<string>`

A function that will be called with the `options` object. It should return a string or a promise that resolves to a string. If `src` is provided, this function will be ignored.

- `write` (optional)
- `write` (опциональный)

**Тип**: `boolean`

Expand Down Expand Up @@ -162,35 +162,35 @@ interface ResolvedNuxtTemplate {

**Тип**: `NuxtTypeTemplate | string`

**Обязательно**: `true`
**Обязательный**: `true`

A template object or a string with the path to the template. If a string is provided, it will be converted to a template object with `src` set to the string value. If a template object is provided, it must have the following properties:

- `src` (optional)
- `src` (опциональный)

**Тип**: `string`

Path to the template. If `src` is not provided, `getContents` must be provided instead.

- `filename` (optional)
- `filename` (опциональный)

**Тип**: `string`

Filename of the template. If `filename` is not provided, it will be generated from the `src` path. In this case, the `src` option is required.

- `dst` (optional)
- `dst` (опциональный)

**Тип**: `string`

Path to the destination file. If `dst` is not provided, it will be generated from the `filename` path and nuxt `buildDir` option.

- `options` (optional)
- `options` (опциональный)

**Тип**: `Options`

Options to pass to the template.

- `getContents` (optional)
- `getContents` (опциональный)

**Тип**: `(data: Options) => string | Promise<string>`

Expand Down Expand Up @@ -252,7 +252,7 @@ interface ResolvedNuxtTemplate {

Options to pass to the template. This object can have the following property:

- `filter` (optional)
- `filter` (опциональный)

**Тип**: `(template: ResolvedNuxtTemplate) => boolean`

Expand Down
Loading
Loading