Skip to content

Commit af1c7ab

Browse files
authored
Merge pull request #2 from tapitapeh/gitlocalize-447
components-nuxt-child.md
2 parents fbe8da8 + f00bdca commit af1c7ab

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

id/api/components-nuxt-child.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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).

0 commit comments

Comments
 (0)