Skip to content

Commit 611ca52

Browse files
isatriomazipan
authored andcommitted
Global API (vuejs#125)
1 parent fe34aca commit 611ca52

File tree

2 files changed

+55
-51
lines changed

2 files changed

+55
-51
lines changed

GLOSARIUM.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737
- Chain: Rantai (atau bisa dengan tetap *Chain*)
3838
- Child: Anak
3939
- Component: Komponen
40+
- Compile: Menyusun/Menghimpun
4041
- Console: Konsol
4142
- Constructor: Konstruktor
43+
- Custom: Khusus
4244

4345
[⬆️](#navigasi-berdasarkan-abjad)
4446

@@ -162,6 +164,7 @@
162164

163165
## S
164166

167+
- String: Untai
165168
- Style: Gaya
166169
- Style Guide: Panduan Gaya
167170
- Single Page Application: Aplikasi *Single-Page*
@@ -175,6 +178,7 @@
175178
## T
176179

177180
- Template: Templat
181+
- Trigger: Picu (memicu/dipicu)
178182

179183
[⬆️](#navigasi-berdasarkan-abjad)
180184

src/v2/api/index.md

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type: api
6060
Vue.config.devtools = true
6161
```
6262

63-
Konfigurasi untuk mengizinkan [vue-devtools](https://github.com/vuejs/vue-devtools) inspeksi. Nilai aggapan dari opsi ini adalah `true` dalam build pengembangan. Dan` false` di build produksi. Anda dapat mengaturnya ke `true` untuk mengaktifkan inspeksi untuk produksi.
63+
Konfigurasi untuk mengizinkan [vue-devtools](https://github.com/vuejs/vue-devtools) inspeksi. Nilai anggapan dari opsi ini adalah `true` dalam build pengembangan. Dan` false` di build produksi. Anda dapat mengaturnya ke `true` untuk mengaktifkan inspeksi untuk produksi.
6464

6565
### errorHandler
6666

@@ -166,7 +166,7 @@ type: api
166166

167167
- **Nilai Anggapan:** `false (from 2.2.3+)`
168168

169-
- **Usage**:
169+
- **Penggunaan**:
170170

171171
Setel ini menjadi `true` untuk mengaktifkan pelacakan inisialisasi komponen, kompilasi, render, dan palacakan performa patch pada browser devtool panel performance/timeline. Hanya berfungsi dalam mode pengembangan dan di browser yang mendukung [performance.mark] (https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API.
172172

@@ -186,21 +186,21 @@ type: api
186186

187187
### Vue.extend( options )
188188

189-
- **Arguments:**
189+
- **Argumen:**
190190
- `{Object} options`
191191

192192
- **Penggunaan:**
193193

194-
Create a "subclass" of the base Vue constructor. The argument should be an object containing component options.
194+
Membuat sebuah "subclass" dari konstruktor. Argumen harus berisi objek yang berisi opsi komponen.
195195

196-
The special case to note here is the `data` option - it must be a function when used with `Vue.extend()`.
196+
Kasus spesial untuk dicatat disini adalah opsi `data` - ini harus berupa fungsi ketika digunakan dengan `Vue.extend()`.
197197

198198
``` html
199199
<div id="mount-point"></div>
200200
```
201201

202202
``` js
203-
// create constructor
203+
// buat konstruktor
204204
var Profile = Vue.extend({
205205
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>',
206206
data: function () {
@@ -211,11 +211,11 @@ type: api
211211
}
212212
}
213213
})
214-
// create an instance of Profile and mount it on an element
214+
// buat sebuah instance dari profil dan pasang ke dalam elemen
215215
new Profile().$mount('#mount-point')
216216
```
217217

218-
Will result in:
218+
Akan menghasilkan:
219219

220220
``` html
221221
<p>Walter White aka Heisenberg</p>
@@ -225,75 +225,75 @@ type: api
225225

226226
### Vue.nextTick( [callback, context] )
227227

228-
- **Arguments:**
228+
- **Argumen:**
229229
- `{Function} [callback]`
230230
- `{Object} [context]`
231231

232232
- **Penggunaan:**
233233

234-
Defer the callback to be executed after the next DOM update cycle. Use it immediately after you've changed some data to wait for the DOM update.
234+
Menangguhkan panggilan balik untuk dieksekusi setelah siklus pembaruan DOM selanjutnya. Gunakan ini segera setelah Anda mengubah beberapa data untuk menunggu untuk pembaruan DOM.
235235

236236
``` js
237-
// modify data
237+
// modifikasi data
238238
vm.msg = 'Hello'
239-
// DOM not updated yet
239+
// DOM belum diperbarui
240240
Vue.nextTick(function () {
241-
// DOM updated
241+
// DOM telah diperbarui
242242
})
243243

244-
// usage as a promise (2.1.0+, see note below)
244+
// gunakan sebagai promise (2.1.0+, lihat catatan di bawah)
245245
Vue.nextTick()
246246
.then(function () {
247-
// DOM updated
247+
// DOM telah diperbarui
248248
})
249249
```
250250

251-
> New in 2.1.0+: returns a Promise if no callback is provided and Promise is supported in the execution environment. Please note that Vue does not come with a Promise polyfill, so if you target browsers that don't support Promises natively (looking at you, IE), you will have to provide a polyfill yourself.
251+
> Baru di 2.1.0+: mengembalikan sebuah _Promise_ jika tidak tersedia panggilan balikdan _Promise_ didukung di lingkungan eksekusi. Tolong catat bahwa Vue tidak datang dengan _Promise_ _polyfill_, jadi jika Anda menargetkan peramban yang tidak mendukung _Promise_ secara bawaan (melihat Anda, IE). Anda harus menyediakan _polyfill_ Anda sendiri.
252252
253253
- **Lihat juga:** [Async Update Queue](../guide/reactivity.html#Async-Update-Queue)
254254

255255
### Vue.set( target, key, value )
256256

257-
- **Arguments:**
257+
- **Argumen:**
258258
- `{Object | Array} target`
259259
- `{string | number} key`
260260
- `{any} value`
261261

262-
- **Returns:** the set value.
262+
- **Returns:** set nilai.
263263

264264
- **Penggunaan:**
265265

266-
Adds a property to a reactive object, ensuring the new property is also reactive, so triggers view updates. This must be used to add new properties to reactive objects, as Vue cannot detect normal property additions (e.g. `this.myObject.newProperty = 'hi'`).
266+
Menambahkan properti ke dalam objek reaktif, menjamin properti baru untuk reaktif juga, jadi memicu pembaruan _view_. Ini harus digunakan untuk menambah properti baru untuk objek reaktif, karena Vue tidak dapat mendeteksi penambahan properti normal (sebagai contoh `this.myObject.newProperty = 'hi'`).
267267

268-
<p class="tip">The target object cannot be a Vue instance, or the root data object of a Vue instance.</p>
268+
<p class="tip">Objek target tidak dapat menjadi _instance_ Vue, atau objek data root dari _instance_ Vue.</p>
269269

270270
- **Lihat juga:** [Reactivity in Depth](../guide/reactivity.html)
271271

272272
### Vue.delete( target, key )
273273

274-
- **Arguments:**
274+
- **Argumen:**
275275
- `{Object | Array} target`
276276
- `{string | number} key/index`
277277

278-
> Only in 2.2.0+: Also works with Array + index.
278+
> Hanya di 2.2.0+: Juga bekerja dengan Array + index.
279279
280280
- **Penggunaan:**
281281

282-
Delete a property on an object. If the object is reactive, ensure the deletion triggers view updates. This is primarily used to get around the limitation that Vue cannot detect property deletions, but you should rarely need to use it.
282+
Menghapus properti dalam objek. Jika objek reaktif, menjamin pembaruan pemicu penghapusan _view_. Ini terutama digunakan untuk mengatasi batasan dimana Vue tidak dapat mendeteksi penghapusan properti, tapi Anda jarang harus menggunakannya.
283283

284-
<p class="tip">The target object cannot be a Vue instance, or the root data object of a Vue instance.</p>
284+
<p class="tip">Objek target tidak dapat menjadi _instance_ Vue, atau objek data root dari _instance_ Vue.</p>
285285

286286
- **Lihat juga:** [Reactivity in Depth](../guide/reactivity.html)
287287

288288
### Vue.directive( id, [definition] )
289289

290-
- **Arguments:**
290+
- **Argumen:**
291291
- `{string} id`
292292
- `{Function | Object} [definition]`
293293

294294
- **Penggunaan:**
295295

296-
Register or retrieve a global directive.
296+
Mendaftarkan atau mengambil directif global.
297297

298298
``` js
299299
// register
@@ -307,94 +307,94 @@ type: api
307307

308308
// register (function directive)
309309
Vue.directive('my-directive', function () {
310-
// this will be called as `bind` and `update`
310+
// ini akan dipanggil sebagai `bind` dan `update`
311311
})
312312

313-
// getter, return the directive definition if registered
313+
// getter, mengembalikan definisi direktif jika terdaftar
314314
var myDirective = Vue.directive('my-directive')
315315
```
316316

317317
- **Lihat juga:** [Custom Directives](../guide/custom-directive.html)
318318

319319
### Vue.filter( id, [definition] )
320320

321-
- **Arguments:**
321+
- **Argumen:**
322322
- `{string} id`
323323
- `{Function} [definition]`
324324

325325
- **Penggunaan:**
326326

327-
Register or retrieve a global filter.
327+
Mendaftarkan atau mengambil filter global.
328328

329329
``` js
330330
// register
331331
Vue.filter('my-filter', function (value) {
332332
// return processed value
333333
})
334334

335-
// getter, return the filter if registered
335+
// getter, mengembalikan filter jika terdaftar
336336
var myFilter = Vue.filter('my-filter')
337337
```
338338

339339
- **Lihat juga:** [Filters](../guide/filters.html)
340340

341341
### Vue.component( id, [definition] )
342342

343-
- **Arguments:**
343+
- **Argumen:**
344344
- `{string} id`
345345
- `{Function | Object} [definition]`
346346

347347
- **Penggunaan:**
348348

349-
Register or retrieve a global component. Registration also automatically sets the component's `name` with the given `id`.
349+
Mendaftarkan atau mengambil komponen global. Pendaftaran juga secara otomatis menset komponen `name` dengan `id` yang diberikan.
350350

351351
``` js
352-
// register an extended constructor
352+
// mendaftarkan sebuah perpanjangan konstruktor
353353
Vue.component('my-component', Vue.extend({ /* ... */ }))
354354

355-
// register an options object (automatically call Vue.extend)
355+
// mendaftarkan opsi objek (secara otomatis memanggil Vue.extend)
356356
Vue.component('my-component', { /* ... */ })
357357

358-
// retrieve a registered component (always return constructor)
358+
// mengambil komponen yang telah terdaftar (selalu mengembalikan konstruktor)
359359
var MyComponent = Vue.component('my-component')
360360
```
361361

362362
- **Lihat juga:** [Components](../guide/components.html)
363363

364364
### Vue.use( plugin )
365365

366-
- **Arguments:**
366+
- **Argumen:**
367367
- `{Object | Function} plugin`
368368

369369
- **Penggunaan:**
370370

371-
Install a Vue.js plugin. If the plugin is an Object, it must expose an `install` method. If it is a function itself, it will be treated as the install method. The install method will be called with Vue as the argument.
371+
Memasang plugin Vue.js. Jika plugin adalah sebuah objek, objek tersebut harus membuka metode `install`. Jika ini adalah fungsinya sendiri, ini akan diperlukan sebagai metode pemasangan. Metode pemasangan akan dipanggil dengan Vue sebagai argumen.
372372

373-
This method has to be called before calling `new Vue()`
373+
Metode ini harus dipanggil sebelum memanggil `new Vue()`
374374

375-
When this method is called on the same plugin multiple times, the plugin will be installed only once.
375+
Ketika metode ini dipanggil dalam plugin yang sama beberapa kali, plugin hanya akan dipasang sekali.
376376

377377
- **Lihat juga:** [Plugins](../guide/plugins.html)
378378

379379
### Vue.mixin( mixin )
380380

381-
- **Arguments:**
381+
- **Argumen:**
382382
- `{Object} mixin`
383383

384384
- **Penggunaan:**
385385

386-
Apply a mixin globally, which affects every Vue instance created afterwards. This can be used by plugin authors to inject custom behavior into components. **Not recommended in application code**.
386+
Menerapkan _mixin_ secara global, akan berpengaruh ke setiap _instance_ Vue yang tercipta setelah itu. Ini dapat digunakan oleh pembuat plugin untuk menginjeksi perilaku khusus ke dalam komponen. **Tidak direkomendasikan dalam kode aplikasi**.
387387

388388
- **Lihat juga:** [Global Mixin](../guide/mixins.html#Global-Mixin)
389389

390390
### Vue.compile( template )
391391

392-
- **Arguments:**
392+
- **Argumen:**
393393
- `{string} template`
394394

395395
- **Penggunaan:**
396396

397-
Compiles a template string into a render function. **Only available in the full build.**
397+
Menghimpun untai templat kedalam fungsi render. **Hanya tersedia dalam build penuh.**
398398

399399
``` js
400400
var res = Vue.compile('<div><span>{{ msg }}</span></div>')
@@ -412,16 +412,16 @@ type: api
412412

413413
### Vue.observable( object )
414414

415-
> New in 2.6.0+
415+
> Baru di 2.6.0+
416416
417-
- **Arguments:**
417+
- **Argumen:**
418418
- `{Object} object`
419419

420420
- **Penggunaan:**
421421

422-
Make an object reactive. Internally, Vue uses this on the object returned by the `data` function.
422+
Membuat sebuah reaktif objek. Secara internal, Vue menggunakan ini dalam objek yang dikembalikan oleh fungsi `data`.
423423

424-
The returned object can be used directly inside [render functions](../guide/render-function.html) and [computed properties](../guide/computed.html), and will trigger appropriate updates when mutated. It can also be used as a minimal, cross-component state store for simple scenarios:
424+
Objek yang dikembalikan dapat digunakan secara langsung dalam [fungsi render](../guide/render-function.html) dan [properti computed](../guide/computed.html), dan akan memicu pembaruan yang sesuai ketika bermutasi. Ini juga dapat digunakan secara minimal, menyimpan _state_ lintas komponen untuk skenario sederhana:
425425

426426
``` js
427427
const state = Vue.observable({ count: 0 })
@@ -435,15 +435,15 @@ type: api
435435
}
436436
```
437437

438-
<p class="tip">In Vue 2.x, `Vue.observable` directly mutates the object passed to it, so that it is equivalent to the object returned, as [demonstrated here](../guide/instance.html#Data-and-Methods). In Vue 3.x, a reactive proxy will be returned instead, leaving the original object non-reactive if mutated directly. Therefore, for future compatibility, we recommend always working with the object returned by `Vue.observable`, rather than the object originally passed to it.</p>
438+
<p class="tip">Dalam Vue 2.x, `Vue.observable` secara langsung memutasikan objek yang dioper ke dalamnya, jadi ini sama dengan pengembalian objek, [didemonstrasikan disini](../guide/instance.html#Data-and-Methods). Dalam Vue 3.x, proksi reaktif akan kembali sebagai gantinya, meninggalkan objek nonreaktif aslinya jika bermutasi secara langsung. Karena itu, untuk kompatibilitas di masa yang akan datang, kami selalu merekomendasikan bekerja dengan objek yang dikembalikan oleh `Vue.observable`, dari pada objek asli yang dioper ke dalamnya.</p>
439439

440440
- **Lihat juga:** [Reactivity in Depth](../guide/reactivity.html)
441441

442442
### Vue.version
443443

444-
- **Details**: Provides the installed version of Vue as a string. This is especially useful for community plugins and components, where you might use different strategies for different versions.
444+
- **Detil**: Menyediakan versi yang terpasang dari Vue sebagai untai. Terutama beguna untuk plugin dan komponen dari komunitas, dimana Anda mungkin menggunakan stretegi berbeda untuk versi yang berbeda.
445445

446-
- **Usage**:
446+
- **Penggunaan**:
447447

448448
```js
449449
var version = Number(Vue.version.split('.')[0])

0 commit comments

Comments
 (0)