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
In addition to passing data via props, the parent component can also pass down template fragments to the child via **slots**:
3
+
Деректерді проптар арқылы жіберумен қатар, ата-ана компоненті баласына **slot** арқылы шаблон фрагменттерін жіберуге де болады:
4
4
5
5
<divclass="sfc">
6
6
7
7
```vue-html
8
8
<ChildComp>
9
-
This is some slot content!
9
+
Бұл слоттың мазмұны!
10
10
</ChildComp>
11
11
```
12
12
@@ -15,35 +15,35 @@ In addition to passing data via props, the parent component can also pass down t
15
15
16
16
```vue-html
17
17
<child-comp>
18
-
This is some slot content!
18
+
Бұл слоттың мазмұны!
19
19
</child-comp>
20
20
```
21
21
22
22
</div>
23
23
24
-
In the child component, it can render the slot content from the parent using the `<slot>`element as outlet:
24
+
Баланың компонентінде, ата-анадан келген слоттың мазмұнын `<slot>`элементі арқылы көрсетуге болады:
25
25
26
26
<divclass="sfc">
27
27
28
28
```vue-html
29
-
<!-- in child template -->
29
+
<!-- бала шаблонында -->
30
30
<slot/>
31
31
```
32
32
33
33
</div>
34
34
<divclass="html">
35
35
36
36
```vue-html
37
-
<!-- in child template -->
37
+
<!-- бала шаблонында -->
38
38
<slot></slot>
39
39
```
40
40
41
41
</div>
42
42
43
-
Content inside the `<slot>` outlet will be treated as "fallback" content: it will be displayed if the parent did not pass down any slot content:
43
+
<slot> шыққан жеріндегі мазмұн «резервтік» мазмұн ретінде қарастырылады: егер ата-ана ешқандай слот мазмұнын бермесе, ол көрсетіледі.
44
44
45
45
```vue-html
46
-
<slot>Fallback content</slot>
46
+
<slot>Резервтік мазмұн</slot>
47
47
```
48
48
49
-
Currently we are not passing any slot content to `<ChildComp>`, so you should see the fallback content. Let's provide some slot content to the child while making use of the parent's `msg` state.
49
+
Қазіргі уақытта біз <ChildComp>-ке ешқандай слот мазмұнын жібермей отырмыз, сондықтан сіз резервтік мазмұнды көруіңіз керек. Енді ата-ананың msg күйін пайдаланып, баласына слот мазмұнын жіберейік.
0 commit comments