Skip to content

Commit ecf92a8

Browse files
authored
Merge pull request vuejs#74 from isatrio/master
PR: Halaman Plugin
2 parents 5920047 + e0243c0 commit ecf92a8

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

GLOSARIUM.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@
4545

4646
## E
4747

48-
- Export: Ekspor
48+
- E.g. (exempli gratia / for example): Sebagai Contoh
4949
- Element: Elemen
50-
- Expression: Ekspresi
5150
- Event: *Event*
51+
- Export: Ekspor
52+
- Expression: Ekspresi
5253

5354
[⬆️](#navigasi-berdasarkan-abjad)
5455

@@ -73,6 +74,7 @@
7374

7475
## I
7576

77+
- I.e. (id est / in other words): Dengan kata lain
7678
- Import: Impor
7779
- Index: Indeks
7880
- Inheritance: Pewarisan

src/v2/guide/plugins.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
11
---
2-
title: Plugins
2+
title: Plugin
33
type: guide
44
order: 304
55
---
66

7-
Plugins usually add global-level functionality to Vue. There is no strictly defined scope for a plugin - there are typically several types of plugins:
7+
Biasanya plugin menambahkan kefungsionalan level-global ke dalam Vue. Tidak ada ruang lingkup yang didefinisikan secara ketat untuk sebuah plugin - Ada beberapa tipe plugin:
88

9-
1. Add some global methods or properties. e.g. [vue-custom-element](https://github.com/karol-f/vue-custom-element)
9+
1. Menambahkan beberapa metode global atau properti. Sebagai contoh [vue-custom-element](https://github.com/karol-f/vue-custom-element)
1010

11-
2. Add one or more global assets: directives/filters/transitions etc. e.g. [vue-touch](https://github.com/vuejs/vue-touch)
11+
2. Menambahkan satu atau lebih aset global: direktif/filter/transisi dan lain-lain. Sebagai contoh [vue-touch](https://github.com/vuejs/vue-touch)
1212

13-
3. Add some component options by global mixin. e.g. [vue-router](https://github.com/vuejs/vue-router)
13+
3. Menambahkan beberapa opsi komponen oleh *mixin* global. Sebagai contoh [vue-router](https://github.com/vuejs/vue-router)
1414

15-
4. Add some Vue instance methods by attaching them to Vue.prototype.
15+
4. Menambahkan beberapa metode *instance* Vue dengan melampirkannya ke dalam Vue.prototype.
1616

17-
5. A library that provides an API of its own, while at the same time injecting some combination of the above. e.g. [vue-router](https://github.com/vuejs/vue-router)
17+
5. Pustaka yang menyediakan API dari dirinya sendiri, dalam waktu yang sama menginjeksi beberapa kombinasi di atas. Sebagai contoh [vue-router](https://github.com/vuejs/vue-router)
1818

19-
## Using a Plugin
19+
## Menggunakan Plugin
2020

21-
Use plugins by calling the `Vue.use()` global method. This has to be done before you start your app by calling `new Vue()`:
21+
Menggunakan plugin dengan memanggil metode global `Vue.use()`. Ini harus dilakukan sebelum Anda memulai aplikasi Anda dengan memanggil `new Vue()`:
2222

2323
``` js
24-
// calls `MyPlugin.install(Vue)`
24+
// memanggil `MyPlugin.install(Vue)`
2525
Vue.use(MyPlugin)
2626

2727
new Vue({
28-
//... options
28+
//... pilihan
2929
})
3030
```
3131

32-
You can optionally pass in some options:
32+
Secara Opsional, Anda bisa mengoper beberapa opsi:
3333

3434
``` js
3535
Vue.use(MyPlugin, { someOption: true })
3636
```
3737

38-
`Vue.use` automatically prevents you from using the same plugin more than once, so calling it multiple times on the same plugin will install the plugin only once.
38+
`Vue.use` secara otomatis mencegah Anda dari menggunakan plugin yang sama lebih dari satu kali, jadi memanggil plugin yang sama beberapa kali hanya akan menginstal plugin satu kali.
3939

40-
Some plugins provided by Vue.js official plugins such as `vue-router` automatically calls `Vue.use()` if `Vue` is available as a global variable. However in a module environment such as CommonJS, you always need to call `Vue.use()` explicitly:
40+
Beberapa plugin disediakan oleh plugin Vue.js resmi seperti `vue-router` secara otomatis memanggil `Vue.use()` jika `Vue` tersedia sebagai variabel global. Bagaimanapun dalam linkungan modul seperti CommonJS, Anda selalu butuh memanggil `Vue.use()` secara eksplisit:
4141

4242
``` js
43-
// When using CommonJS via Browserify or Webpack
43+
// Ketika menggunakan CommonJS via Browserify atau Webpack
4444
var Vue = require('vue')
4545
var VueRouter = require('vue-router')
4646

47-
// Don't forget to call this
47+
// Jangan lupa untuk memanggil fungsi ini
4848
Vue.use(VueRouter)
4949
```
5050

51-
Checkout [awesome-vue](https://github.com/vuejs/awesome-vue#components--libraries) for a huge collection of community-contributed plugins and libraries.
51+
Cek [awesome-vue](https://github.com/vuejs/awesome-vue#components--libraries) untuk koleksi yang banyak dari kontribusi plugin dan pustaka komunitas.
5252

53-
## Writing a Plugin
53+
## Menulis Plugin
5454

55-
A Vue.js plugin should expose an `install` method. The method will be called with the `Vue` constructor as the first argument, along with possible options:
55+
Plugin Vue.js harus membuka metode `install`. Metode akan dipanggil dengan konstruktor `Vue` sebagai argumen pertama, bersama dengan opsi yang memungkinkan:
5656

5757
``` js
5858
MyPlugin.install = function (Vue, options) {
59-
// 1. add global method or property
59+
// 1. tambahkan metode global atau properti
6060
Vue.myGlobalMethod = function () {
61-
// some logic ...
61+
// logika ...
6262
}
6363

64-
// 2. add a global asset
64+
// 2. tambahkan aset global
6565
Vue.directive('my-directive', {
6666
bind (el, binding, vnode, oldVnode) {
67-
// some logic ...
67+
// logika ...
6868
}
6969
...
7070
})
7171

72-
// 3. inject some component options
72+
// 3. injeksi beberapa opsi komponen
7373
Vue.mixin({
7474
created: function () {
75-
// some logic ...
75+
// logika ...
7676
}
7777
...
7878
})
7979

80-
// 4. add an instance method
80+
// 4. tambahkan metode instance
8181
Vue.prototype.$myMethod = function (methodOptions) {
82-
// some logic ...
82+
// logika ...
8383
}
8484
}
8585
```

0 commit comments

Comments
 (0)