You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All VNodes in the component tree must be unique. That means the following render function is invalid:
288
+
Semua VNode yang ada di silsilah pohon komponen harus unik. Artinya, contoh di bawah salah:
289
289
290
290
```js
291
291
render:function (createElement) {
@@ -297,7 +297,7 @@ render: function (createElement) {
297
297
}
298
298
```
299
299
300
-
If you really want to duplicate the same element/component many times, you can do so with a factory function. For example, the following render function is a perfectly valid way of rendering 20 identical paragraphs:
300
+
Jika kalian memang ingin menduplikasi elemen/komponen yang sama beberapa kali, kalian bisa menggunakan fungsi *factory*. Di bawah ini adalah contoh yang valid untuk menampilkan 20 paragraf yang sama:
301
301
302
302
```js
303
303
render:function (createElement) {
@@ -309,11 +309,11 @@ render: function (createElement) {
309
309
}
310
310
```
311
311
312
-
## Replacing Template Features with Plain JavaScript
312
+
## Mengganti Fitur Templat Dengan JavaScript
313
313
314
-
### `v-if`and`v-for`
314
+
### `v-if`dan`v-for`
315
315
316
-
Wherever something can be easily accomplished in plain JavaScript, Vue render functions do not provide a proprietary alternative. For example, in a template using `v-if`and`v-for`:
316
+
Jika ada hal sederhana yang bisa dicapai dengan mudah menggunakan JavaScript, fungsi render Vue tidak menyediakan cara khusus untuk melakukannya. Contohnya, penggunaan `v-if`dan`v-for` di templat:
317
317
318
318
```html
319
319
<ulv-if="items.length">
@@ -322,7 +322,7 @@ Wherever something can be easily accomplished in plain JavaScript, Vue render fu
322
322
<pv-else>No items found.</p>
323
323
```
324
324
325
-
This could be rewritten with JavaScript's `if`/`else`and`map`in a render function:
325
+
Bisa ditulis dengan `if`/`else`dan`map`bawaan dari JavaScript:
326
326
327
327
```js
328
328
props: ['items'],
@@ -339,7 +339,7 @@ render: function (createElement) {
339
339
340
340
### `v-model`
341
341
342
-
There is no direct `v-model`counterpart in render functions - you will have to implement the logic yourself:
342
+
Tidak ada fitur yang mirip `v-model`di fungsi render, kalian harus menerapkannya sendiri:
343
343
344
344
```js
345
345
props: ['value'],
@@ -358,11 +358,11 @@ render: function (createElement) {
358
358
}
359
359
```
360
360
361
-
This is the cost of going lower-level, but it also gives you much more control over the interaction details compared to`v-model`.
361
+
Mungkin terasa lebih susah, tapi kalian punya kendali penuh dibandingkan`v-model`.
362
362
363
-
### Event & Key Modifiers
363
+
### *Event* & *Key Modifiers*
364
364
365
-
For the `.passive`, `.capture` and`.once` event modifiers, Vue offers prefixes that can be used with`on`:
365
+
Untuk modifier event seperti `.passive`, `.capture`, dan`.once`; Vue memberikan prefix yang bisa digunakan dengan`on`:
366
366
367
367
| Modifier(s) | Prefix |
368
368
| ------ | ------ |
@@ -371,7 +371,7 @@ For the `.passive`, `.capture` and `.once` event modifiers, Vue offers prefixes
371
371
|`.once`|`~`|
372
372
|`.capture.once` or<br>`.once.capture`|`~!`|
373
373
374
-
For example:
374
+
Contoh:
375
375
376
376
```javascript
377
377
on: {
@@ -381,7 +381,7 @@ on: {
381
381
}
382
382
```
383
383
384
-
For all other event and key modifiers, no proprietary prefix is necessary, because you can use event methods in the handler:
384
+
Untuk event dan key modifier lainnya, tidak ada prefix yang dibutuhkan, cukup gunakan event method-nya di handler:
385
385
386
386
| Modifier(s) | Equivalent in Handler |
387
387
| ------ | ------ |
@@ -391,30 +391,30 @@ For all other event and key modifiers, no proprietary prefix is necessary, becau
391
391
| Keys:<br>`.enter`, `.13`|`if (event.keyCode !== 13) return` (change `13` to [another key code](http://keycode.info/) for other key modifiers) |
392
392
| Modifiers Keys:<br>`.ctrl`, `.alt`, `.shift`, `.meta`|`if (!event.ctrlKey) return` (change `ctrlKey` to `altKey`, `shiftKey`, or `metaKey`, respectively) |
393
393
394
-
Here's an example with all of these modifiers used together:
394
+
Berikut contoh untuk penggunaan modifier di atas:
395
395
396
396
```javascript
397
397
on: {
398
398
keyup:function (event) {
399
-
//Abort if the element emitting the event is not
400
-
//the element the event is bound to
399
+
//Batalkan jika elemen yang menghasilkan event ini bukan
400
+
//elemen tempat event-nya di pasang
401
401
if (event.target!==event.currentTarget) return
402
-
//Abort if the key that went up is not the enter
403
-
//key (13) and the shift key was not held down
404
-
//at the same time
402
+
//Batalkan jika key yang ditekan bukanlah tombol enter,
403
+
//dan tombol shift tidak ditekan
404
+
//di waktu yang sama
405
405
if (!event.shiftKey||event.keyCode!==13) return
406
-
//Stop event propagation
406
+
//Hentikan propagasi event
407
407
event.stopPropagation()
408
-
//Prevent the default keyup handler for this element
408
+
//Hentikan event handler dasar untuk event ini
409
409
event.preventDefault()
410
410
// ...
411
411
}
412
412
}
413
413
```
414
414
415
-
### Slots
415
+
### Slot
416
416
417
-
You can access static slot contents as Arrays of VNodes from[`this.$slots`](../api/#vm-slots):
417
+
Kalian bisa mengakses isi slot statik sebagai array VNode dari[`this.$slots`](../api/#vm-slots):
418
418
419
419
```js
420
420
render:function (createElement) {
@@ -423,7 +423,7 @@ render: function (createElement) {
423
423
}
424
424
```
425
425
426
-
And access scoped slots as functions that return VNodes from[`this.$scopedSlots`](../api/#vm-scopedSlots):
426
+
Dan mengakses slot berlingkup (scoped) sebagai fungsi yang mengembalikan VNode dari[`this.$scopedSlots`](../api/#vm-scopedSlots):
427
427
428
428
```js
429
429
props: ['message'],
@@ -437,14 +437,14 @@ render: function (createElement) {
437
437
}
438
438
```
439
439
440
-
To pass scoped slots to a child component using render functions, use the`scopedSlots`field in VNode data:
440
+
Untuk meneruskan slot berlingkup ke komponen di dalamnya melalui fungsi render, gunakan field`scopedSlots`di data VNode:
441
441
442
442
```js
443
443
render:function (createElement) {
444
444
returncreateElement('div', [
445
445
createElement('child', {
446
-
//pass `scopedSlots` in the data object
447
-
//in the form of { name: props => VNode | Array<VNode> }
446
+
//teruskan `scopedSlots` di objek data
447
+
//dalam bentuk { name: props => VNode | Array<VNode> }
0 commit comments