File tree 1 file changed +49
-0
lines changed
1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : ' API: '
3
+ description : Menampilkan halaman saat ini
4
+ ---
5
+
6
+ # Komponen <nuxt-child >
7
+
8
+ > Komponen ini digunakan untuk menampilkan "children" komponen pada [ nested route] ( /guide/routing#nested-routes )
9
+
10
+ Contoh:
11
+
12
+ ``` bash
13
+ -| pages/
14
+ ---| parent/
15
+ ------| child.vue
16
+ ---| parent.vue
17
+ ```
18
+
19
+ File tree di atas akan menghasilkan routes sebagai berikut:
20
+
21
+ ``` js
22
+ [
23
+ {
24
+ path: ' /parent' ,
25
+ component: ' ~/pages/parent.vue' ,
26
+ name: ' parent' ,
27
+ children: [
28
+ {
29
+ path: ' child' ,
30
+ component: ' ~/pages/parent/child.vue' ,
31
+ name: ' parent-child'
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ ```
37
+
38
+ Untuk menampilkan komponen ` child.vue ` , kita harus memasukan ` <nuxt-child/> ` ke dalam ` pages/parent.vue ` :
39
+
40
+ ``` html
41
+ <template >
42
+ <div >
43
+ <h1 >I am the parent view</h1 >
44
+ <nuxt-child />
45
+ </div >
46
+ </template >
47
+ ```
48
+
49
+ Untuk melihat contoh, silahkan lihat [ contoh nested-routes] ( /examples/nested-routes ) .
You can’t perform that action at this time.
0 commit comments