Skip to content

Commit b8b3e62

Browse files
committed
Добавляет перевод части статьи setup
1 parent b40f769 commit b8b3e62

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/api/sfc-script-setup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ const post = await fetch(`/api/post/1`).then((r) => r.json())
483483

484484
## Import Statements {#imports-statements}
485485

486-
Import statements in vue follow [ECMAScript module specification](https://nodejs.org/api/esm.html).
487-
In addition, you can use aliases defined in your build tool configuration:
486+
Во Vue import statements следуют [спецификации модулей ECMAScript](https://nodejs.org/api/esm.html).
487+
Кроме того, вы можете использовать алиасы, определённые в конфигурации вашего инструмента сборки.:
488488

489489
```vue
490490
<script setup>
@@ -524,7 +524,7 @@ defineProps<{
524524
</script>
525525
```
526526

527-
You can use `@vue-generic` the directive to pass in explicit types, for when the type cannot be inferred:
527+
Вы можете использовать директиву `@vue-generic` для передачи явных типов, когда система не может вывести их автоматически:
528528

529529
```vue
530530
<template>
@@ -536,7 +536,7 @@ You can use `@vue-generic` the directive to pass in explicit types, for when the
536536
</template>
537537
```
538538

539-
In order to use a reference to a generic component in a `ref` you need to use the [`vue-component-type-helpers`](https://www.npmjs.com/package/vue-component-type-helpers) library as `InstanceType` won't work.
539+
Чтобы использовать ссылку на generic-компонент в `ref`, необходима библиотека [`vue-component-type-helpers`](https://www.npmjs.com/package/), так как `InstanceType` в этом случае неприменим.
540540

541541
```vue
542542
<script
@@ -548,13 +548,13 @@ import genericComponent from '../generic-component.vue';
548548
549549
import type { ComponentExposed } from 'vue-component-type-helpers';
550550
551-
// Works for a component without generics
551+
// Работает для компонента без дженериков
552552
ref<InstanceType<typeof componentWithoutGenerics>>();
553553
554554
ref<ComponentExposed<typeof genericComponent>>();
555555
```
556556

557-
## Restrictions {#restrictions}
557+
## Ограничения {#restrictions}
558558

559559
- Из-за разницы в семантике выполнения модулей код внутри `<script setup>` полагается на контекст SFC. Если перенести их во внешние файлы `.js` или `.ts`, это может привести к путанице как для разработчиков, так и для инструментов. Поэтому **`<script setup>`** нельзя использовать с атрибутом `src`.
560560
- `<script setup>` не поддерживает шаблон корневого компонента In-DOM. ([Связанные обсуждения](https://github.com/vuejs/core/issues/8391))

0 commit comments

Comments
 (0)