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
Copy file name to clipboardExpand all lines: src/v2/api/index.md
+63-63Lines changed: 63 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1003,21 +1003,21 @@ type: api
1003
1003
1004
1004
- **Detail:**
1005
1005
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.
1007
1007
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>
1009
1009
1010
1010
### mixins
1011
1011
1012
1012
- **Tipe:** `Array<Object>`
1013
1013
1014
1014
- **Detail:**
1015
1015
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.
1017
1017
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.
1019
1019
1020
-
- **Example:**
1020
+
- **Contoh:**
1021
1021
1022
1022
``` js
1023
1023
var mixin = {
@@ -1039,16 +1039,16 @@ type: api
1039
1039
1040
1040
- **Detail:**
1041
1041
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.
1043
1043
1044
-
This is similar to`mixins`.
1044
+
Fungsi ini mirip dengan`mixins`.
1045
1045
1046
-
- **Example:**
1046
+
- **Contoh:**
1047
1047
1048
1048
``` js
1049
1049
var CompA = { ... }
1050
1050
1051
-
// extend CompA without having to call `Vue.extend` on either
1051
+
// extend CompA tanpa perlu memanggil `Vue.extend` di keduanya
<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>
1069
1069
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.
1071
1071
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`.
1073
1073
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
1081
1081
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.
1083
1083
1084
-
- **Example:**
1084
+
- **Contoh:**
1085
1085
1086
1086
``` js
1087
-
//parent component providing 'foo'
1087
+
//komponen induk menyediakan 'foo'
1088
1088
var Provider = {
1089
1089
provide: {
1090
1090
foo:'bar'
1091
1091
},
1092
1092
// ...
1093
1093
}
1094
1094
1095
-
//child component injecting 'foo'
1096
-
varChild= {
1095
+
//komponen anak menginjeksi 'foo'
1096
+
varAnak= {
1097
1097
inject: ['foo'],
1098
1098
created () {
1099
1099
console.log(this.foo) // => "bar"
@@ -1102,7 +1102,7 @@ type: api
1102
1102
}
1103
1103
```
1104
1104
1105
-
With ES2015 Symbols, function`provide`and object`inject`:
1105
+
Dengan ES2015 Symbols, fungsi`provide`dan objek`inject`:
1106
1106
``` js
1107
1107
consts=Symbol()
1108
1108
@@ -1114,17 +1114,17 @@ type: api
1114
1114
}
1115
1115
}
1116
1116
1117
-
constChild= {
1117
+
constAnak= {
1118
1118
inject: { s },
1119
1119
// ...
1120
1120
}
1121
1121
```
1122
1122
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`.
1124
1124
1125
-
Using an injected value as the default for a prop:
1125
+
Menggunakan nilai yang terinjeksi sebagai nilai anggapan untuk sebuah `prop`:
1126
1126
```js
1127
-
constChild= {
1127
+
constAnak= {
1128
1128
inject: ['foo'],
1129
1129
props: {
1130
1130
bar: {
@@ -1136,9 +1136,9 @@ type: api
1136
1136
}
1137
1137
```
1138
1138
1139
-
Using an injected value as data entry:
1139
+
Menggunakan nilai yang terinjeksi sebagai data:
1140
1140
```js
1141
-
constChild= {
1141
+
constAnak= {
1142
1142
inject: ['foo'],
1143
1143
data () {
1144
1144
return {
@@ -1148,20 +1148,20 @@ type: api
1148
1148
}
1149
1149
```
1150
1150
1151
-
> In 2.5.0+ injections can be optional with default value:
1151
+
> Di versi 2.5.0+ injeksi bersifat opsional dengan nilai anggapan:
1152
1152
1153
1153
``` js
1154
-
constChild= {
1154
+
constAnak= {
1155
1155
inject: {
1156
1156
foo: { default:'foo' }
1157
1157
}
1158
1158
}
1159
1159
```
1160
1160
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:
1162
1162
1163
1163
``` js
1164
-
constChild= {
1164
+
constAnak= {
1165
1165
inject: {
1166
1166
foo: {
1167
1167
from:'bar',
@@ -1171,10 +1171,10 @@ type: api
1171
1171
}
1172
1172
```
1173
1173
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:
1175
1175
1176
1176
``` js
1177
-
constChild= {
1177
+
constAnak= {
1178
1178
inject: {
1179
1179
foo: {
1180
1180
from:'bar',
@@ -1190,25 +1190,25 @@ type: api
1190
1190
1191
1191
- **Tipe:** `string`
1192
1192
1193
-
- **Batasan:** only respected when used as a component option.
1193
+
- **Batasan:** Gunakan hanya sebagai opsi komponen.
1194
1194
1195
1195
- **Detail:**
1196
1196
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.
1198
1198
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.
1200
1200
1201
1201
### delimiters
1202
1202
1203
1203
- **Tipe:** `Array<string>`
1204
1204
1205
1205
- **Nilai Anggapan:** `{% raw %}["{{", "}}"]{% endraw %}`
1206
1206
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.
1208
1208
1209
1209
- **Detail:**
1210
1210
1211
-
Change the plain text interpolation delimiters.
1211
+
Mengubah pembatas interpolasi teks normal.
1212
1212
1213
1213
- **Example:**
1214
1214
@@ -1217,7 +1217,7 @@ type: api
1217
1217
delimiters: ['${', '}']
1218
1218
})
1219
1219
1220
-
//Delimiters changed to ES6 template string style
1220
+
//Delimiter diubah menjadi menggunakan ES6 template string
1221
1221
```
1222
1222
1223
1223
### functional
@@ -1226,32 +1226,32 @@ type: api
1226
1226
1227
1227
- **Detail:**
1228
1228
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_.
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.
1242
1242
1243
-
- **Example:**
1243
+
- **Contoh:**
1244
1244
1245
1245
``` js
1246
-
Vue.component('my-checkbox', {
1246
+
Vue.component('checkbox-saya', {
1247
1247
model: {
1248
1248
prop:'checked',
1249
1249
event:'change'
1250
1250
},
1251
1251
props: {
1252
-
//this allows using the `value` prop for a different purpose
1252
+
//mengizinkan menggunakan prop `value` untuk tujuan lain
1253
1253
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`
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`.
1289
1289
1290
-
Note: this option does **not** affect `class`and`style` bindings.
1290
+
Catatan: opsi ini **tidak** mempengaruhi ikatan `class`dan`style`.
1291
1291
1292
1292
### comments
1293
1293
1294
-
> New in 2.4.0+
1294
+
> Baru di versi 2.4.0+
1295
1295
1296
1296
- **Tipe:** `boolean`
1297
1297
1298
1298
- **Nilai Anggapan:** `false`
1299
1299
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.
1301
1301
1302
1302
- **Detail:**
1303
1303
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.
0 commit comments