Skip to content

Commit

Permalink
Merge pull request #2 from tapitapeh/gitlocalize-447
Browse files Browse the repository at this point in the history
components-nuxt-child.md
  • Loading branch information
tapitapeh authored Jan 25, 2018
2 parents fbe8da8 + f00bdca commit af1c7ab
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions id/api/components-nuxt-child.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: 'API: '
description: Menampilkan halaman saat ini
---

# Komponen <nuxt-child>

> Komponen ini digunakan untuk menampilkan "children" komponen pada [nested route](/guide/routing#nested-routes)
Contoh:

```bash
-| pages/
---| parent/
------| child.vue
---| parent.vue
```

File tree di atas akan menghasilkan routes sebagai berikut:

```js
[
{
path: '/parent',
component: '~/pages/parent.vue',
name: 'parent',
children: [
{
path: 'child',
component: '~/pages/parent/child.vue',
name: 'parent-child'
}
]
}
]
```

Untuk menampilkan komponen `child.vue`, kita harus memasukan `<nuxt-child/>` ke dalam `pages/parent.vue`:

```html
<template>
<div>
<h1>I am the parent view</h1>
<nuxt-child/>
</div>
</template>
```

Untuk melihat contoh, silahkan lihat [contoh nested-routes](/examples/nested-routes).

0 comments on commit af1c7ab

Please sign in to comment.