Skip to content

Commit 8ab956d

Browse files
Paskalouismazipan
authored andcommitted
[API] Options / Composition (vuejs#177)
* Add translation on sub-section: parent * Add translation for sub-section mixins * Add translation for sub-section extends and provide/inject * Add translation on option misc * cleanup translation
1 parent 42758ec commit 8ab956d

File tree

1 file changed

+63
-63
lines changed

1 file changed

+63
-63
lines changed

src/v2/api/index.md

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,21 +1003,21 @@ type: api
10031003
10041004
- **Detail:**
10051005
1006-
Specify the parent instance for the instance to be created. Establishes a parent-child relationship between the two. The parent will be accessible as `this.$parent` for the child, and the child will be pushed into the parent's `$children` array.
1006+
Tentukan _instance_ induk untuk _instance_ yang akan dibuat. Bangun hubungan induk-anak di antara keduanya. Induk dapat diakses sebagai`this.$parent` di dalam _instance_ anak, dan _instance_ anak akan dimasukkan ke dalem _array_ `$children` induknya.
10071007
1008-
<p class="tip">Use `$parent` and `$children` sparingly - they mostly serve as an escape-hatch. Prefer using props and events for parent-child communication.</p>
1008+
<p class="tip">Gunakan `$parent` dan `$children` secukupnya - dikarenakan mereka kebanyakan digunakan sebagai pintu darurat. Utamakan penggunaan _props_ dan _events_ untuk komunikasi induk-anak.</p>
10091009
10101010
### mixins
10111011
10121012
- **Tipe:** `Array<Object>`
10131013
10141014
- **Detail:**
10151015
1016-
The `mixins` option accepts an array of mixin objects. These mixin objects can contain instance options like normal instance objects, and they will be merged against the eventual options using the same option merging logic in `Vue.extend()`. e.g. If your mixin contains a created hook and the component itself also has one, both functions will be called.
1016+
`mixins` menerima sebuah array berisi objek _mixin_. Kumpulan objek _mixin_ ini dapat berisi opsi _instance_ seperti _instance_ objek pada umumnya, dan mereka akan digabungkan dengan opsi yang ditambah menggunakan logika penggabungan opsi yang sama seperti `Vue.extend()`. Contoh: Jika `mixin` anda mengandung _hook_ dan komponen itu sendiri juga memiliki _hook_ yang sama, maka kedua fungsi akan dipanggil.
10171017
1018-
Mixin hooks are called in the order they are provided, and called before the component's own hooks.
1018+
_hook_ mixin dipanggil sesuai dengan urutan dimana mereka disediakan, dan dipanggil sebelum _hook_ komponen itu sendiri.
10191019
1020-
- **Example:**
1020+
- **Contoh:**
10211021
10221022
``` js
10231023
var mixin = {
@@ -1039,16 +1039,16 @@ type: api
10391039
10401040
- **Detail:**
10411041
1042-
Allows declaratively extending another component (could be either a plain options object or a constructor) without having to use `Vue.extend`. This is primarily intended to make it easier to extend between single file components.
1042+
Secara deklaratif mengekstensi komponen lain (bisa antara objek opsi polos, atau sebuah konstruktor) tanpa menggunakan `Vue.extend`. Tujuan utama dari _extends_ adalah mempermudah ekstensi antara Komponen Berkas Tunggal.
10431043
1044-
This is similar to `mixins`.
1044+
Fungsi ini mirip dengan `mixins`.
10451045
1046-
- **Example:**
1046+
- **Contoh:**
10471047
10481048
``` js
10491049
var CompA = { ... }
10501050

1051-
// extend CompA without having to call `Vue.extend` on either
1051+
// extend CompA tanpa perlu memanggil `Vue.extend` di keduanya
10521052
var CompB = {
10531053
extends: CompA,
10541054
...
@@ -1057,43 +1057,43 @@ type: api
10571057
10581058
### provide / inject
10591059
1060-
> New in 2.2.0+
1060+
> Baru di versi 2.2.0+
10611061
10621062
- **Tipe:**
10631063
- **provide:** `Object | () => Object`
10641064
- **inject:** `Array<string> | { [key: string]: string | Symbol | Object }`
10651065
10661066
- **Detail:**
10671067
1068-
<p class="tip">`provide` and `inject` are primarily provided for advanced plugin / component library use cases. It is NOT recommended to use them in generic application code.</p>
1068+
<p class="tip">`provide` dan `inject` khususnya disediakan untuk _plugin_ lanjutan / kasus pemakaian pustaka komponen. Fungsi ini TIDAK direkomendasikan untuk digunakan dalam kode aplikasi secara umum.</p>
10691069
1070-
This pair of options are used together to allow an ancestor component to serve as a dependency injector for all its descendants, regardless of how deep the component hierarchy is, as long as they are in the same parent chain. If you are familiar with React, this is very similar to React's context feature.
1070+
Kedua opsi ini digunakan untuk mengizinkan komponen terdahulu sebagai penyuntik _dependencies_ ke semua keturunannya, mengesampingkan seberapa dalam komponen hirarkinya, selama mereka ada di dalam rantai komponen induk yang sama. Jika anda _familiar_ dengan React, ini sangat mirip dengan fitur konteks React.
10711071
1072-
The `provide` option should be an object or a function that returns an object. This object contains the properties that are available for injection into its descendants. You can use ES2015 Symbols as keys in this object, but only in environments that natively support `Symbol` and `Reflect.ownKeys`.
1072+
Tipe opsi `provide` harus sebuah objek atau sebuah fungsi yang mengembalikan sebuah object. Objek ini mengandung properti-properti yang tersedia untuk diinjeksikan ke keturunannya. Anda dapat menggunakan ES2015 Symbols sebagai _keys_ di objek ini, tapi hanya di lingkungan yang secara _native_ mendukung `Symbol` dan `Reflect.ownKeys`.
10731073
1074-
The `inject` option should be either:
1075-
- an array of strings, or
1076-
- an object where the keys are the local binding name and the value is either:
1077-
- the key (string or Symbol) to search for in available injections, or
1078-
- an object where:
1079-
- the `from` property is the key (string or Symbol) to search for in available injections, and
1080-
- the `default` property is used as fallback value
1074+
Opsi `inject` harus di antara berikut:
1075+
- sebuah array berisi untai
1076+
- sebuah objek dimana _keys_ adalah nama _binding_ lokal dan nilainya di antara:
1077+
- _key_ (untai atau Symbol) untuk mencari injeksi yang tersedia, atau
1078+
- sebuah objek dimana:
1079+
- properti `from` adalah _key_ (untai atau Symbol) untuk mencari injeksi yang tersedia, dan
1080+
- properti `default` yang digunakan sebagai nilai pada saat terjadi kegagalan
10811081
1082-
> Note: the `provide` and `inject` bindings are NOT reactive. This is intentional. However, if you pass down an observed object, properties on that object do remain reactive.
1082+
> Catatan: ikatan `provide` dan `inject` tidak bersifat reaktif. Hal ini disengaja. Namun, apabila anda menurunkan objek yang diobservasi, properti-properti dalam objek tersebut tetap reaktif.
10831083
1084-
- **Example:**
1084+
- **Contoh:**
10851085
10861086
``` js
1087-
// parent component providing 'foo'
1087+
// komponen induk menyediakan 'foo'
10881088
var Provider = {
10891089
provide: {
10901090
foo: 'bar'
10911091
},
10921092
// ...
10931093
}
10941094

1095-
// child component injecting 'foo'
1096-
var Child = {
1095+
// komponen anak menginjeksi 'foo'
1096+
var Anak = {
10971097
inject: ['foo'],
10981098
created () {
10991099
console.log(this.foo) // => "bar"
@@ -1102,7 +1102,7 @@ type: api
11021102
}
11031103
```
11041104
1105-
With ES2015 Symbols, function `provide` and object `inject`:
1105+
Dengan ES2015 Symbols, fungsi `provide` dan objek `inject`:
11061106
``` js
11071107
const s = Symbol()
11081108

@@ -1114,17 +1114,17 @@ type: api
11141114
}
11151115
}
11161116

1117-
const Child = {
1117+
const Anak = {
11181118
inject: { s },
11191119
// ...
11201120
}
11211121
```
11221122
1123-
> The next 2 examples work with Vue 2.2.1+. Below that version, injected values were resolved after the `props` and the `data` initialization.
1123+
> Dua contoh dibawah hanya bisa berjalan dengan Vue 2.2.1+. Nilai-nilai yang diinjeksi diselesaikan setelah inisialisasi `props` dan `data`.
11241124
1125-
Using an injected value as the default for a prop:
1125+
Menggunakan nilai yang terinjeksi sebagai nilai anggapan untuk sebuah `prop`:
11261126
```js
1127-
const Child = {
1127+
const Anak = {
11281128
inject: ['foo'],
11291129
props: {
11301130
bar: {
@@ -1136,9 +1136,9 @@ type: api
11361136
}
11371137
```
11381138
1139-
Using an injected value as data entry:
1139+
Menggunakan nilai yang terinjeksi sebagai data:
11401140
```js
1141-
const Child = {
1141+
const Anak = {
11421142
inject: ['foo'],
11431143
data () {
11441144
return {
@@ -1148,20 +1148,20 @@ type: api
11481148
}
11491149
```
11501150
1151-
> In 2.5.0+ injections can be optional with default value:
1151+
> Di versi 2.5.0+ injeksi bersifat opsional dengan nilai anggapan:
11521152
11531153
``` js
1154-
const Child = {
1154+
const Anak = {
11551155
inject: {
11561156
foo: { default: 'foo' }
11571157
}
11581158
}
11591159
```
11601160
1161-
If it needs to be injected from a property with a different name, use `from` to denote the source property:
1161+
Jika komponen tersebut memerlukan injeksi dari properti dengan nama yang lain, gunakan `from` untuk menandakan sumber properti:
11621162
11631163
``` js
1164-
const Child = {
1164+
const Anak = {
11651165
inject: {
11661166
foo: {
11671167
from: 'bar',
@@ -1171,10 +1171,10 @@ type: api
11711171
}
11721172
```
11731173
1174-
Similar to prop defaults, you need to use a factory function for non primitive values:
1174+
Mirip dengan nilai anggapan _prop_, anda harus menggunakan fungsi pabrik untuk nilai non-primitif:
11751175
11761176
``` js
1177-
const Child = {
1177+
const Anak = {
11781178
inject: {
11791179
foo: {
11801180
from: 'bar',
@@ -1190,25 +1190,25 @@ type: api
11901190
11911191
- **Tipe:** `string`
11921192
1193-
- **Batasan:** only respected when used as a component option.
1193+
- **Batasan:** Gunakan hanya sebagai opsi komponen.
11941194
11951195
- **Detail:**
11961196
1197-
Allow the component to recursively invoke itself in its template. Note that when a component is registered globally with `Vue.component()`, the global ID is automatically set as its name.
1197+
Mengizinkan sebuah komponen untuk memanggil dirinya sendiri di dalam templatnya sendiri secara rekursif. Catat bahwa ketika sebuah komponen terdaftar secara global dengan `Vue.component()`, ID global secara otomatis ditetapkan sebagai namanya.
11981198
1199-
Another benefit of specifying a `name` option is debugging. Named components result in more helpful warning messages. Also, when inspecting an app in the [vue-devtools](https://github.com/vuejs/vue-devtools), unnamed components will show up as `<AnonymousComponent>`, which isn't very informative. By providing the `name` option, you will get a much more informative component tree.
1199+
Keuntungan lain dengan menspesifikasikan sebuah opsi `name` adalah _debugging_. Komponen dengan nama lebih membantu dalam pesan peringatan. Dan juga, ketika memeriksa sebuah aplikasi di dalam [vue-devtools](https://github.com/vuejs/vue-devtools), komponen tanpa nama akan muncul sebagai `<AnonymousComponent>`, dimana tidak informatif sama sekali. Dengan menambahkan opsi `name`, anda akan mendapatkan struktur komponen yang lebih informatif.
12001200
12011201
### delimiters
12021202
12031203
- **Tipe:** `Array<string>`
12041204
12051205
- **Nilai Anggapan:** `{% raw %}["{{", "}}"]{% endraw %}`
12061206
1207-
- **Batasan:** This option is only available in the full build, with in-browser compilation.
1207+
- **Batasan:** Opsi ini hanya tersedia di _full build_, dalam kompilasi peramban.
12081208
12091209
- **Detail:**
12101210
1211-
Change the plain text interpolation delimiters.
1211+
Mengubah pembatas interpolasi teks normal.
12121212
12131213
- **Example:**
12141214
@@ -1217,7 +1217,7 @@ type: api
12171217
delimiters: ['${', '}']
12181218
})
12191219

1220-
// Delimiters changed to ES6 template string style
1220+
// Delimiter diubah menjadi menggunakan ES6 template string
12211221
```
12221222
12231223
### functional
@@ -1226,32 +1226,32 @@ type: api
12261226
12271227
- **Detail:**
12281228
1229-
Causes a component to be stateless (no `data`) and instanceless (no `this` context). They are only a `render` function that returns virtual nodes making them much cheaper to render.
1229+
Menyebabkan sebuah komponen menjadi tanpa kondisi (tanpa `data`) dan tanpa _instance_ (tanpa konteks `this`). Komponen tersebut hanya berisi fungsi `render` yang mengembalikan node virtual agar membuat komponen tersebut lebih efektif untuk _dirender_.
12301230
12311231
- **Lihat juga:** [Functional Components](../guide/render-function.html#Functional-Components)
12321232
12331233
### model
12341234
1235-
> New in 2.2.0
1235+
> Baru di versi 2.2.0
12361236
12371237
- **Tipe:** `{ prop?: string, event?: string }`
12381238
12391239
- **Detail:**
12401240
1241-
Allows a custom component to customize the prop and event used when it's used with `v-model`. By default, `v-model` on a component uses `value` as the prop and `input` as the event, but some input types such as checkboxes and radio buttons may want to use the `value` prop for a different purpose. Using the `model` option can avoid the conflict in such cases.
1241+
Mengizinkan sebuah komponen khusus untuk menyesuaikan _prop_ dan _event_ ketika digunakan bersama `v-model`. Secara standar, `v-model` dalam sebuah komponen menggunakan `value` sebagai _prop_ dan `input` sebagai _event_, namun beberapa tipe _input_ seperti tombol centang dan tombol radio ingin menggunakan _prop_ `value` untuk tujuan yang lain. Menggunakan opsi `model` dapat menghindari konflik dalam kasus seperti ini.
12421242
1243-
- **Example:**
1243+
- **Contoh:**
12441244
12451245
``` js
1246-
Vue.component('my-checkbox', {
1246+
Vue.component('checkbox-saya', {
12471247
model: {
12481248
prop: 'checked',
12491249
event: 'change'
12501250
},
12511251
props: {
1252-
// this allows using the `value` prop for a different purpose
1252+
// mengizinkan menggunakan prop `value` untuk tujuan lain
12531253
value: String,
1254-
// use `checked` as the prop which take the place of `value`
1254+
// menggunakan `checked` sebagai prop yang akan menimpa nilai dari `value`
12551255
checked: {
12561256
type: Number,
12571257
default: 0
@@ -1262,46 +1262,46 @@ type: api
12621262
```
12631263
12641264
``` html
1265-
<my-checkbox v-model="foo" value="some value"></my-checkbox>
1265+
<checkbox-saya v-model="foo" value="sebuah nilai"></checkbox-saya>
12661266
```
12671267
1268-
The above will be equivalent to:
1268+
Kode di atas sama dengan:
12691269
12701270
``` html
1271-
<my-checkbox
1271+
<checkbox-saya
12721272
:checked="foo"
1273-
@change="val => { foo = val }"
1274-
value="some value">
1275-
</my-checkbox>
1273+
@change="nilai => { foo = nilai }"
1274+
value="sebuah nilai">
1275+
</checkbox-saya>
12761276
```
12771277
12781278
### inheritAttrs
12791279
1280-
> New in 2.4.0+
1280+
> Baru di versi 2.4.0+
12811281
12821282
- **Tipe:** `boolean`
12831283
12841284
- **Nilai Anggapan:** `true`
12851285
12861286
- **Detail:**
12871287
1288-
By default, parent scope attribute bindings that are not recognized as props will "fallthrough" and be applied to the root element of the child component as normal HTML attributes. When authoring a component that wraps a target element or another component, this may not always be the desired behavior. By setting `inheritAttrs` to `false`, this default behavior can be disabled. The attributes are available via the `$attrs` instance property (also new in 2.4) and can be explicitly bound to a non-root element using `v-bind`.
1288+
Secara standar, Ikatan atribut dalam cakupan induk yang tidak dikenali sebagai _prop_ akan "gagal" dan akan diaplikasikan ke elemen akar dari komponen anak sebagai atribut HTML normal. Ketika membuat sebuah komponen yang membungkus sebuah elemen target atau komponen lain, opsi ini tidak selalu menghasilkan hasil yang diinginkan. Dengan mengubah nilai `inheritAttrs` menjadi `false`, kejadian standar ini dapat dinonaktifkan. Atribut yang tersedia melalui properti _instance_ `$attrs` (baru di 2.4) dan bisa diikat secara eksplisit ke elemen yang bukan akar menggunakan `v-bind`.
12891289
1290-
Note: this option does **not** affect `class` and `style` bindings.
1290+
Catatan: opsi ini **tidak** mempengaruhi ikatan `class` dan `style`.
12911291
12921292
### comments
12931293
1294-
> New in 2.4.0+
1294+
> Baru di versi 2.4.0+
12951295
12961296
- **Tipe:** `boolean`
12971297
12981298
- **Nilai Anggapan:** `false`
12991299
1300-
- **Batasan:** This option is only available in the full build, with in-browser compilation.
1300+
- **Batasan:** Opsi ini hanya tersedia di _full build_, dalam kompilasi peramban.
13011301
13021302
- **Detail:**
13031303
1304-
When set to `true`, will preserve and render HTML comments found in templates. The default behavior is discarding them.
1304+
Ketika nilai diubah ke `true`, akan menyimpan dan _merender_ komen HTML yang ditemukan di templat. Tindakan normal secara umum adalah dengan membuangnya.
13051305
13061306
## Instance Properties
13071307

0 commit comments

Comments
 (0)