Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(id): Penerjemahan pada berkas guide/migration - Part 3 #260

Open
wants to merge 3 commits into
base: indonesian
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions src/guide/migration/render-function-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@ badges:
- breaking
---

# Render Function API <MigrationBadges :badges="$frontmatter.badges" />
# API Fungsi Render <MigrationBadges :badges="$frontmatter.badges" />

## Overview
## Gambaran Umum

This change will not affect `<template>` users.
Perubahan ini tidak berdampak pada pengguna `<template>`.

Here is a quick summary of what has changed:
Berikut adalah ringkasan sekilas apa yang telah berubah:

- `h` is now globally imported instead of passed to render functions as an argument
- render function arguments changed to be more consistent between stateful and functional components
- VNodes now have a flat props structure
- `h` sekarang terimpor secara global daripada dilewatkan ke fungsi render sebagai argumen
- argumen fungsi render diubah menjadi lebih konsisten antara komponen-komponen stateful dan functional
- VNodes sekarang mempunyai struktur flat props

For more information, read on!
Untuk informasi lebih lanjut, baca seterusnya!

## Render Function Argument
## Argumen Fungsi Render

### 2.x Syntax
### 2.x Sintaksis

In 2.x, the `render` function would automatically receive the `h` function (which is a conventional alias for `createElement`) as an argument:
Pada 2.x, fungsi `render` akan secara otomatis menerima fungsi `h` (yang merupakan sebuah alias konvensional untuk `createElement`) sebagai sebuah argumen:

```js
// Vue 2 Render Function Example
// Contoh Vue 2 Fungsi Render
export default {
render(h) {
return h('div')
}
}
```

### 3.x Syntax
### 3.x Sintaksis

In 3.x, `h` is now globally imported instead of being automatically passed as an argument.
Pada 3.x, `h` sekarang secara global diimpor daripada secara otomatis dilewatkan sebagai sebuah argumen.

```js
// Vue 3 Render Function Example
// Contoh Vue 3 Fungsi Render
import { h } from 'vue'

export default {
Expand All @@ -47,24 +47,24 @@ export default {
}
```

## Render Function Signature Change
## Perubahaan Signature Fungsi Render

### 2.x Syntax
### 2.x Sintaksis

In 2.x, the `render` function automatically received arguments such as `h`.
Pada 2.x, fungsi `render` secara otomatis menerima argumen seperti `h`.

```js
// Vue 2 Render Function Example
// Contoh Vue 2 Fungsi Render
export default {
render(h) {
return h('div')
}
}
```

### 3.x Syntax
### 3.x Sintaksis

In 3.x, since the `render` function no longer receives any arguments, it will primarily be used inside of the `setup()` function. This has the added benefit of gaining access to reactive state and functions declared in scope, as well as the arguments passed to `setup()`.
Pada 3.x, dikarenakan fungsi `render` tidak lagi menerima argumen apapun, Fungsi ini akan secara primer digunakan di dalam fungsi `setup()`. Hal ini akan memberikan keuntungan dalam mendapatkan akses ke keadaan reaktif dan fungsi-fungsi dideklarasikan di scope, sama baiknya argumen dilewatkan ke `setup()`.

```js
import { h, reactive } from 'vue'
Expand All @@ -79,7 +79,7 @@ export default {
state.count++
}

// return the render function
// return fungsi render
return () =>
h(
'div',
Expand All @@ -92,13 +92,13 @@ export default {
}
```

For more information on how `setup()` works, see our [Composition API Guide](/guide/composition-api-introduction.html).
Untuk informasi mengenai bagaimana `setup()` bekerja, baca [Paduan Composition API](/guide/composition-api-introduction.html).

## VNode Props Format
## Format VNode Props

### 2.x Syntax
### 2.x Sintaksis

In 2.x, `domProps` contained a nested list within the VNode props:
Pada 2.x, `domProps` berisikan sebuah daftar bersarang di dalam VNode props:

```js
// 2.x
Expand All @@ -114,12 +114,12 @@ In 2.x, `domProps` contained a nested list within the VNode props:
}
```

### 3.x Syntax
### 3.x Sintaksis

In 3.x, the entire VNode props structure is flattened. Using the example from above, here is what it would look like now.
Pada 3.x, semua struktru VNode props telah diratakan. Menggunakan contoh di atas, berikut ini bagaimana sintaksis tampak.

```js
// 3.x Syntax
// 3.x Sintaksis
{
class: ['button', { 'is-outlined': isOutlined }],
style: [{ color: '#34495E' }, { backgroundColor: buttonColor }],
Expand All @@ -130,11 +130,11 @@ In 3.x, the entire VNode props structure is flattened. Using the example from ab
}
```

## Registered Component
## Komponen Teregistrasi

### 2.x Syntax
### 2.x Sintaksis

In 2.x, when a component has been registered, the render function would work well when passing the component's name as a string to the first argument:
Pada 2.x, ketika sebuah komponen telah teregistrasi, fungsi render akan bekerja dengan baik ketika melewatkan nama komponen sebagai sebuah string ke argumen pertama:

```js
// 2.x
Expand All @@ -158,9 +158,9 @@ export default {
}
```

### 3.x Syntax
### 3.x Sintaksis

In 3.x, with VNodes being context-free, we can no longer use a string ID to implicitly lookup registered components. Instead, we need to use an imported `resolveComponent` method:
Pada 3.x, dengan VNodes menjadi bebas konteks, kita tidak lagi dapat menggunakan sebuah ID string untuk secara implisit mencari komponen-komponen yang teregistrasi. Dengan demikian, kita memerlukan sebuah method `resolveComponent` yang diimpor:

```js
// 3.x
Expand All @@ -174,20 +174,20 @@ export default {
}
```

For more information, see [The Render Function Api Change RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md#context-free-vnodes).
Untuk informasi lebih lanjut, lihat [Api Fungsi Render mengubah RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md#context-free-vnodes).

## Migration Strategy
## Strategi Migrasi

[Migration build flag: `RENDER_FUNCTION`](migration-build.html#compat-configuration)

### Library Authors
### Pencipta Library

`h` being globally imported means that any library that contains Vue components will include `import { h } from 'vue'` somewhere. As a result, this creates a bit of overhead since it requires library authors to properly configure the externalization of Vue in their build setup:
`h` menjadi secara global diimpor berarti library apa saja yang berisi komponen-komponen Vue akan memasukkan `import { h } from 'vue'` di suatu tempat. Hasilnya, hal ini membuat sedikit pengaturan tambahan dikarenakan memerlukan pencipta library untuk secara benar mengkonfigurasikan eksternalisasi dari Vue di build setup mereka:

- Vue should not be bundled into the library
- For module builds, the import should be left alone and be handled by the end user bundler
- For UMD / browser builds, it should try the global Vue.h first and fallback to require calls
- Vue tidak boleh dibundel ke dalam library
- Untuk module builds, import harus dibiarkan sendiri dan ditangani oleh bundler pengguna akhir
- Untuk UMD / browser builds, harus mencoba global Vue.h dahulu dan fallback memerlukan calls

## Next Steps
## Langkah Berikutnya

See [Render Function Guide](/guide/render-function) for more detailed documentation!
Lihat [Panduan Fungsi Render](/guide/render-function) untuk dokumentasi secara lebih detail!
44 changes: 22 additions & 22 deletions src/guide/migration/slots-unification.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,65 @@ badges:
- breaking
---

# Slots Unification <MigrationBadges :badges="$frontmatter.badges" />
# Penyatuan Slot <MigrationBadges :badges="$frontmatter.badges" />

## Overview
## Gambaran Umum

This change unifies normal and scoped slots in 3.x.
Perubahan ini menyatukan slot-slot normal dan scoped di 3.x.

Here is a quick summary of what has changed:
Berikut adalah gambaran sekilas apa yang berubah:

- `this.$slots` now exposes slots as functions
- **BREAKING**: `this.$scopedSlots` is removed
- `this.$slots` sekarang mengekspos slot-slot sebagai fungsi
- **BREAKING**: `this.$scopedSlots` telah dihapuskan

For more information, read on!
Untuk informasi lebih lanjut, silahkan baca!

## 2.x Syntax
## 2.x Sintaksis

When using the render function, i.e., `h`, 2.x used to define the `slot` data property on the content nodes.
Ketika menggunakan fungsi render, contoh, `h`, 2.x sebelumnya mendefinisikan properti data `slot` di node-node konten.

```js
// 2.x Syntax
// 2.x Sintaksis
h(LayoutComponent, [
h('div', { slot: 'header' }, this.header),
h('div', { slot: 'content' }, this.content)
])
```

In addition, when referencing scoped slots, they could be referenced using the following syntax:
Tambahan, ketika mereferensikan slot-slot scoped, dapat direferensikan menggunakan sintaksis berikut:

```js
// 2.x Syntax
// 2.x Sintaksis
this.$scopedSlots.header
```

## 3.x Syntax
## 3.x Sintaksis

In 3.x, slots are defined as children of the current node as an object:
Pada 3.x, slot-slot didefinisikan sebagai anak dari node orang tua sebagai objek:

```js
// 3.x Syntax
// 3.x Sintaksis
h(LayoutComponent, {}, {
header: () => h('div', this.header),
content: () => h('div', this.content)
})
```

And when you need to reference scoped slots programmatically, they are now unified into the `$slots` option.
Dan ketika Anda butuh mereferensikan slot-slot scoped secara terprogram, mereka sekarang tergabung dalam opsi `$slots`.

```js
// 2.x Syntax
// 2.x Sintaksis
this.$scopedSlots.header

// 3.x Syntax
// 3.x Sintaksis
this.$slots.header()
```

## Migration Strategy
## Strategi Migrasi

A majority of the change has already been shipped in 2.6. As a result, the migration can happen in one step:
Perubahan skala besar telah dikirimkan di 2.6. Sebagai hasilnya, migrasi dapat terjadi dengan satu langkah:

1. Replace all `this.$scopedSlots` occurrences with `this.$slots` in 3.x.
2. Replace all occurrences of `this.$slots.mySlot` with `this.$slots.mySlot()`
1. Mengubah semua `this.$scopedSlots` bentuk dengan `this.$slots` di 3.x.
2. Mengubah semua bentuk dari `this.$slots.mySlot` dengan `this.$slots.mySlot()`

[Migration build flag: `INSTANCE_SCOPED_SLOTS`](migration-build.html#compat-configuration)
18 changes: 9 additions & 9 deletions src/guide/migration/transition-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ badges:

# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />

## Overview
## Gambaran Umum

`<transition-group>` no longer renders a root element by default, but can still create one with the `tag` attribute.
`<transition-group>` tidak lagi merender sebuah element root secara default, tetapi masih dapat membuatnya menggunakan prop `tag`.

## 2.x Syntax
## 2.x Sintaksis

In Vue 2, `<transition-group>`, like other custom components, needed a root element, which by default was a `<span>` but was customizable via the `tag` attribute.
Pada Vue 2, `<transition-group>`, seperti komponen-komponen kustom lainnya, membutuhkan sebuah element root, dimana secara default adalah sebuah `<span>` tetapi dikostumisasi menggunakan prop `tag`.

```html
<transition-group tag="ul">
Expand All @@ -22,12 +22,12 @@ In Vue 2, `<transition-group>`, like other custom components, needed a root elem
</transition-group>
```

## 3.x Syntax
## 3.x Sintaksis

In Vue 3, we have [fragment support](/guide/migration/fragments.html), so components no longer _need_ a root node. Consequently, `<transition-group>` no longer renders one by default.
Pada Vue 3, Kami mempunyai [fragment support](/guide/migration/fragments.html), sehingga komponen-komponen tidak lagi _membutuhkan_ sebuah node root. Sehingga, `<transition-group>` tidak lagi merendernya secara default.

- If you already have the `tag` attribute defined in your Vue 2 code, like in the example above, everything will work as before
- If you didn't have one defined _and_ your styling or other behaviors relied on the presence of the `<span>` root element to work properly, simply add `tag="span"` to the `<transition-group>`:
- Jika Anda telah mempunyai prop `tag` terdefinisikan pada code Vue 2 Anda, seperti contoh diatas, semuanya akan bekerja normal seperti sebelumnya
- Jika ANda belum mendefenisikan _dan_ gaya Anda dan perilaku lainnya mengandalkan kepada adanya element root`<span>` untuk bekerja, Sederhananya, tambahkan `tag="span"` di `<transition-group>`:

```html
<transition-group tag="span">
Expand All @@ -39,7 +39,7 @@ In Vue 3, we have [fragment support](/guide/migration/fragments.html), so compon

[Migration build flag: `TRANSITION_GROUP_ROOT`](migration-build.html#compat-configuration)

## See also
## Lihat Juga

- [Some transition classes got a rename](/guide/migration/transition.html)
- [`<Transition>` as a root can no longer be toggled from the outside](/guide/migration/transition-as-root.html)