You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a high level overview of what has changed:
10
+
Ось короткий огляд того, що змінилося:
11
11
12
-
-New `defineAsyncComponent` helper method that explicitly defines async components
13
-
-`component`option renamed to`loader`
14
-
-Loader function does not inherently receive `resolve`and`reject`arguments and must return a Promise
12
+
-Новий допоміжний метод `defineAsyncComponent`, який явно визначає асинхронні компоненти
13
+
-Опцію `component`перейменовано на`loader`
14
+
-Функція завантажувача в сутності не отримує аргументів `resolve`і`reject`і має повертати Promise
15
15
16
-
For a more in-depth explanation, read on!
16
+
Щоб отримати подальші пояснення, читайте далі!
17
17
18
-
## Introduction
18
+
## Вступ
19
19
20
-
Previously, async components were created by simply defining a component as a function that returned a promise, such as:
20
+
Раніше асинхронні компоненти створювали простим визначенням компонента як функції, яка повертала Promise, наприклад:
21
21
22
22
```js
23
23
constasyncModal= () =>import('./Modal.vue')
24
24
```
25
25
26
-
Or, for the more advanced component syntax with options:
26
+
Або, для більш просунутого синтаксису компонента з опціями:
27
27
28
28
```js
29
29
constasyncModal= {
@@ -35,19 +35,19 @@ const asyncModal = {
35
35
}
36
36
```
37
37
38
-
## 3.x Syntax
38
+
## Синтаксис 3.x
39
39
40
-
Now, in Vue 3, since functional components are defined as pure functions, async components definitions need to be explicitly defined by wrapping it in a new `defineAsyncComponent` helper:
40
+
Тепер, у Vue 3, оскільки функціональні компоненти визначені як чисті функції, визначення асинхронних компонентів потрібно чітко визначати, обернувши їх у новий хелпер `defineAsyncComponent`:
Vue Router supports a similar mechanism for asynchronously loading route components, known as *lazy loading*. Despite the similarities, this feature is distinct from Vue's support for async components. You should **not**use `defineAsyncComponent`when configuring route components with Vue Router. You can read more about this in the [Lazy Loading Routes](https://router.vuejs.org/guide/advanced/lazy-loading.html)section of the Vue Router documentation.
60
+
::: tip Примітка
61
+
Vue Router підтримує подібний механізм для асинхронного завантаження маршрутних компонентів, відомий як *відкладене завантаження*. Незважаючи на схожість, ця функція відрізняється від підтримки Vue асинхронних компонентів. Вам **не**слід використовувати `defineAsyncComponent`під час налаштування компонентів маршруту за допомогою Vue Router. Ви можете прочитати більше про це в розділі [Маршрути відкладеного завантаження](https://router.vuejs.org/guide/advanced/lazy-loading.html)документації Vue Router.
62
62
:::
63
63
64
-
Another change that has been made from 2.x is that the `component`option is now renamed to `loader` in order to accurately communicate that a component definition cannot be provided directly.
64
+
Ще одна зміна, яка була зроблена порівняно з 2.x, полягає в тому, що опція `component`тепер перейменована на `loader`, щоб точно повідомити, що визначення компонента не можна надати безпосередньо.
0 commit comments