Skip to content

Commit 159cf30

Browse files
isatriomazipan
authored andcommittedOct 27, 2019
Built-in Component API (#186)
* Global API * Translated practical-use-of-scoped-slots and update GLOSARIUM * Forgot to change the title * Translated Built-in Component API
1 parent 69d2ad0 commit 159cf30

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed
 

‎src/v2/api/index.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ Digunakan untuk menunjukkan bahwa sebuah elemen `<template>` adalah *scoped slot
24622462
24632463
Sama seperti [`slot-scope`](#slot-scope), hanya saja `scope` hanya bisa digunakan pada elemen `<template>`.
24642464
2465-
## Built-In Components
2465+
## Komponen Built-In
24662466
24672467
### component
24682468
@@ -2472,27 +2472,27 @@ Digunakan untuk menunjukkan bahwa sebuah elemen `<template>` adalah *scoped slot
24722472
24732473
- **Penggunaan:**
24742474
2475-
A "meta component" for rendering dynamic components. The actual component to render is determined by the `is` prop:
2475+
"Komponen meta" untuk merender komponen dinamis. Komponen yang sesungguhnya yang di-render ditentukan oleh prop `is`:
24762476
24772477
```html
2478-
<!-- a dynamic component controlled by -->
2479-
<!-- the `componentId` property on the vm -->
2478+
<!-- komponen dinamis dikendalikan oleh -->
2479+
<!-- properti `componentId` dalam vm -->
24802480
<component :is="componentId"></component>
24812481
2482-
<!-- can also render registered component or component passed as prop -->
2482+
<!-- dapat pula merender komponen yang telah didaftarkan atau komponen dioper sebagai prop -->
24832483
<component :is="$options.components.child"></component>
24842484
```
24852485
2486-
- **Lihat juga:** [Dynamic Components](../guide/components.html#Dynamic-Components)
2486+
- **Lihat juga:** [Komponen Dinamis](../guide/components.html#Dynamic-Components)
24872487
24882488
### transition
24892489
24902490
- **Props:**
2491-
- `name` - string, Used to automatically generate transition CSS class names. e.g. `name: 'fade'` will auto expand to `.fade-enter`, `.fade-enter-active`, etc. Defaults to `"v"`.
2492-
- `appear` - boolean, Whether to apply transition on initial render. Defaults to `false`.
2493-
- `css` - boolean, Whether to apply CSS transition classes. Defaults to `true`. If set to `false`, will only trigger JavaScript hooks registered via component events.
2494-
- `type` - string, Specify the type of transition events to wait for to determine transition end timing. Available values are `"transition"` and `"animation"`. By default, it will automatically detect the type that has a longer duration.
2495-
- `mode` - string, Controls the timing sequence of leaving/entering transitions. Available modes are `"out-in"` and `"in-out"`; defaults to simultaneous.
2491+
- `name` - string, Digunakan untuk menghasilkan nama kelas CSS transisi secara otomatis. Sebagai contoh `name: 'fade'` akan otomatis _expand_ ke `.fade-enter`, `.fade-enter-active`, dan lain-lain. Nilai bawaan `"v"`.
2492+
- `appear` - boolean, Apakah akan menerapkan transisi dalam render awal. Nilai bawaan `false`.
2493+
- `css` - boolean, Apakah akan menerapkan _class_ transisi CSS. Nilai bawaan `true`. Jika diatur menjadi `false`, hanya akan memicu _hook_ Javascript teregistrasi via _event_ komponen.
2494+
- `type` - string, Menentukan tipe _event_ transisi untuk menunggu untuk memastikan waktu akhir transisi. Nilai yang tersedia adalah `"transition"` dan `"animation"`. Secara bawaan, ini akan secara otomatis mendeteksi tipe yang memiliki durasi lebih lama.
2495+
- `mode` - string, Mengontrol urutan waktu dari transisi pergi/masuk. Mode yang tersedia adalah `"out-in"` dan `"in-out"`; nilai bawaan serentak.
24962496
- `enter-class` - string
24972497
- `leave-class` - string
24982498
- `appear-class` - string
@@ -2519,20 +2519,20 @@ Digunakan untuk menunjukkan bahwa sebuah elemen `<template>` adalah *scoped slot
25192519
25202520
- **Penggunaan:**
25212521
2522-
`<transition>` serve as transition effects for **single** element/component. The `<transition>` only applies the transition behavior to the wrapped content inside; it doesn't render an extra DOM element, or show up in the inspected component hierarchy.
2522+
`<transition>` disajikan sebagai efek transisi untuk elemen/komponen **tunggal**. `<transition>` hanya menerapkan tingkah laku transisi untuk konten yang terbungkus di dalam; ini tidak merender elemen DOM tambahan, atau ditampilkan dalam hirarki komponen yang terinspeksi.
25232523
25242524
```html
2525-
<!-- simple element -->
2525+
<!-- elemen sedehana -->
25262526
<transition>
25272527
<div v-if="ok">toggled content</div>
25282528
</transition>
25292529
2530-
<!-- dynamic component -->
2530+
<!-- komponen dinamis -->
25312531
<transition name="fade" mode="out-in" appear>
25322532
<component :is="view"></component>
25332533
</transition>
25342534
2535-
<!-- event hooking -->
2535+
<!-- pengait event -->
25362536
<div id="transition-demo">
25372537
<transition @after-enter="transitionComplete">
25382538
<div v-show="ok">toggled content</div>
@@ -2552,25 +2552,25 @@ Digunakan untuk menunjukkan bahwa sebuah elemen `<template>` adalah *scoped slot
25522552
}).$mount('#transition-demo')
25532553
```
25542554
2555-
- **Lihat juga:** [Transitions: Entering, Leaving, and Lists](../guide/transitions.html)
2555+
- **Lihat juga:** [Transisi: Masuk, Pergi, dan Daftar Transisi lainnya](../guide/transitions.html)
25562556
25572557
### transition-group
25582558
25592559
- **Props:**
2560-
- `tag` - string, defaults to `span`.
2561-
- `move-class` - overwrite CSS class applied during moving transition.
2562-
- exposes the same props as `<transition>` except `mode`.
2560+
- `tag` - string, nilai bawaan `span`.
2561+
- `move-class` - menimpa _class_ CSS yand diterapkan selama transisi berjalan.
2562+
- membuka _prop_ yang sama sebagai `<transition>` kecuali `mode`.
25632563
25642564
- **Events:**
2565-
- exposes the same events as `<transition>`.
2565+
- membuka _event_ yang sama sebagai `<transition>`.
25662566
25672567
- **Penggunaan:**
2568+
2569+
`<transition-group>` disajikan sebagai efek transisi untuk elemen/komponen **berganda**. `<transition-group>` merender elemen DOM yang sebenarnya. Sebagai bawaan ini menernder `<span>`. dan Anda dapat mengkonfigurasi elemen apa yang harus dirender melalui atribut `tag`.
25682570
2569-
`<transition-group>` serve as transition effects for **multiple** elements/components. The `<transition-group>` renders a real DOM element. By default it renders a `<span>`, and you can configure what element it should render via the `tag` attribute.
2571+
Catatan setiap _child_ dalam `<transition-group>` harus memiliki **kunci yang unik** agar animasi bekerja dengan baik.
25702572
2571-
Note every child in a `<transition-group>` must be **uniquely keyed** for the animations to work properly.
2572-
2573-
`<transition-group>` supports moving transitions via CSS transform. When a child's position on screen has changed after an update, it will get applied a moving CSS class (auto generated from the `name` attribute or configured with the `move-class` attribute). If the CSS `transform` property is "transition-able" when the moving class is applied, the element will be smoothly animated to its destination using the [FLIP technique](https://aerotwist.com/blog/flip-your-animations/).
2573+
`<transition-group>` mendukung transisi berjalan melalui transform CSS. Ketika posisi sebuah _child_ dalam layar berganti setekah pembaruan, ini akan menerapkan _class_ CSS berjalan (otomatis dihasilkan dari atribut `name` atau terkonfigurasi dengan atribut `move-class`). Jika properti `transform` CSS adalah "transition-able" ketika _class_ berjalan diterapkan, elemen akan teranimasi dengan lancar ke destinasi menggunakan [teknik FLIP](https://aerotwist.com/blog/flip-your-animations/).
25742574
25752575
```html
25762576
<transition-group tag="ul" name="slide">
@@ -2580,100 +2580,100 @@ Digunakan untuk menunjukkan bahwa sebuah elemen `<template>` adalah *scoped slot
25802580
</transition-group>
25812581
```
25822582
2583-
- **Lihat juga:** [Transitions: Entering, Leaving, and Lists](../guide/transitions.html)
2583+
- **Lihat juga:** [Transisi: Masuk, Pergi, dan Daftar Transisi lainnya](../guide/transitions.html)
25842584
25852585
### keep-alive
25862586
25872587
- **Props:**
2588-
- `include` - string or RegExp or Array. Only components with matching names will be cached.
2589-
- `exclude` - string or RegExp or Array. Any component with a matching name will not be cached.
2590-
- `max` - number. The maximum number of component instances to cache.
2588+
- `include` - string atau RegExp atau Array. Hanya komponen dengan nama yang cocok akan dimasukan _cache_.
2589+
- `exclude` - string atau RegExp atau Array. Komponen apapun dengan nama yang cocok tidak akan dimasukan _cache_.
2590+
- `max` - number. Angka maksimum dari instan komponen yang dapat masuk ke daam _cache_.
25912591
25922592
- **Penggunaan:**
25932593
2594-
When wrapped around a dynamic component, `<keep-alive>` caches the inactive component instances without destroying them. Similar to `<transition>`, `<keep-alive>` is an abstract component: it doesn't render a DOM element itself, and doesn't show up in the component parent chain.
2594+
Kerika membungkus komponen dinamis, _cache_ `<keep-alive` instan komponen tidak aktif tanpa menghancurkannya. Seperti `<transition>`, `<keep-alive>` adalah komponen abstrak: tidak merender elemen DOM sendiri, dan tidak tampil dalam rantai komponen _parent_.
25952595
2596-
When a component is toggled inside `<keep-alive>`, its `activated` and `deactivated` lifecycle hooks will be invoked accordingly.
2596+
Ketika komponen diaktifkan dalam `<keep-alive>`, kait siklus hidup `activated` dan `deactivated` akan diminta sesuai.
25972597
2598-
> In 2.2.0+ and above, `activated` and `deactivated` will fire for all nested components inside a `<keep-alive>` tree.
2598+
> Dalam 2.2.0+ ke atas, `activated` dan `deactivated` akan menyala untuk semua komponen bersarang di dalam pohon `<keep-alive>`.
25992599
2600-
Primarily used to preserve component state or avoid re-rendering.
2600+
Terutama digunakan untuk mempertahankan _state_ komponen atau menghindari merender ulang.
26012601
26022602
```html
2603-
<!-- basic -->
2603+
<!-- dasar -->
26042604
<keep-alive>
26052605
<component :is="view"></component>
26062606
</keep-alive>
26072607
2608-
<!-- multiple conditional children -->
2608+
<!-- kondisional _children_ berganda -->
26092609
<keep-alive>
26102610
<comp-a v-if="a > 1"></comp-a>
26112611
<comp-b v-else></comp-b>
26122612
</keep-alive>
26132613
2614-
<!-- used together with `<transition>` -->
2614+
<!-- digunakan bersama dengan `<transition>` -->
26152615
<transition>
26162616
<keep-alive>
26172617
<component :is="view"></component>
26182618
</keep-alive>
26192619
</transition>
26202620
```
26212621
2622-
Note, `<keep-alive>` is designed for the case where it has one direct child component that is being toggled. It does not work if you have `v-for` inside it. When there are multiple conditional children, as above, `<keep-alive>` requires that only one child is rendered at a time.
2622+
Catatan, `<keep-alive>` didesain untuk kasus dimana komponen memiliki satu komponen _child_ yang sedang diaktifkan. Ini tidak bekerja jika Anda memiliki `v-for` di dalamnya. Ketika disana terdapat kondisional _children_ berganda, sebagaimana di atas, `<keep-alive>` memerlukan hanya satu _child_ dirender dalam satu waktu.
26232623
26242624
- **`include` and `exclude`**
26252625
2626-
> New in 2.1.0+
2626+
> Baru di 2.1.0+
26272627
2628-
The `include` and `exclude` props allow components to be conditionally cached. Both props can be a comma-delimited string, a RegExp or an Array:
2628+
_Prop_ `include` dan `exclude` mengijinkan komponen untuk secara kondisional dimasukan ke daam _cache_. Semua _prop_ dapat menjadi string _comma-delimited_, sebuah RegExp atau Array:
26292629
26302630
``` html
26312631
<!-- comma-delimited string -->
26322632
<keep-alive include="a,b">
26332633
<component :is="view"></component>
26342634
</keep-alive>
26352635
2636-
<!-- regex (use `v-bind`) -->
2636+
<!-- regex (gunakan `v-bind`) -->
26372637
<keep-alive :include="/a|b/">
26382638
<component :is="view"></component>
26392639
</keep-alive>
26402640
2641-
<!-- Array (use `v-bind`) -->
2641+
<!-- Array (gunakan `v-bind`) -->
26422642
<keep-alive :include="['a', 'b']">
26432643
<component :is="view"></component>
26442644
</keep-alive>
26452645
```
26462646
2647-
The match is first checked on the component's own `name` option, then its local registration name (the key in the parent's `components` option) if the `name` option is not available. Anonymous components cannot be matched against.
2647+
Kecocokan adalah yang pertama kali diperiksa pada opsi `name` komponen itu sendiri, lalu nama registrasi lokal (kunci dalam opsi komponen _parent_) jika opsi `name` tidak tersedia. Komponen anonim tidak dapat dicocokan.
26482648
26492649
- **`max`**
26502650
26512651
> New in 2.5.0+
26522652
2653-
The maximum number of component instances to cache. Once this number is reached, the cached component instance that was least recently accessed will be destroyed before creating a new instance.
2653+
Angka maksimum dari instan komponen untuk dimasukan ke dalam _cache_. Saat angka ini tercapai, instan komponen dalam _cache_ yang paling sedikit diakses akan dihancurkan sebelum membuat instan baru.
26542654
26552655
``` html
26562656
<keep-alive :max="10">
26572657
<component :is="view"></component>
26582658
</keep-alive>
26592659
```
26602660
2661-
<p class="tip">`<keep-alive>` does not work with functional components because they do not have instances to be cached.</p>
2661+
<p class="tip">`<keep-alive>` tidak bekerja dengan komponen fungsional karena mereka tidak memiliki instan untuk dimasukan ke dalam _cache_.</p>
26622662
2663-
- **Lihat juga:** [Dynamic Components - keep-alive](../guide/components.html#keep-alive)
2663+
- **Lihat juga:** [Komponen Dinamis - keep-alive](../guide/components.html#keep-alive)
26642664
26652665
### slot
26662666
26672667
- **Props:**
2668-
- `name` - string, Used for named slot.
2668+
- `name` - string, Digunakan untuk menamai slot.
26692669
26702670
- **Penggunaan:**
26712671
2672-
`<slot>` serve as content distribution outlets in component templates. `<slot>` itself will be replaced.
2672+
`<slot>` disajikan sebagai outlet distribusi konten dalam templat komponen. `<slot>` sendiri akan digantikan.
26732673
2674-
For detailed usage, see the guide section linked below.
2674+
Untuk detil penggunaan, lihat bagian petunjuk tautan di bawah.
26752675
2676-
- **Lihat juga:** [Content Distribution with Slots](../guide/components.html#Content-Distribution-with-Slots)
2676+
- **Lihat juga:** [Distribusi konten dengan Slot](../guide/components.html#Content-Distribution-with-Slots)
26772677
26782678
## VNode Interface
26792679

0 commit comments

Comments
 (0)
Please sign in to comment.