Skip to content

Commit e1fe85c

Browse files
iqbalaqabamazipan
authored andcommitted
Translate Bahasa Indonesia dari : Component Registration (vuejs#62)
* Translate Bahasa Indonesia : Permintaan Vue * fixed typo and few things * Update typo * updated another typo * updated translation of lifecycle hook * Translate Bahasa Indonesia : Properti Penghitung & Pengawas * fixed typos and translation * Translate Bahasa Indonesia : Component Registrasi * fixed translation * fixed translation
1 parent 7e5e5cb commit e1fe85c

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

src/v2/guide/components-registration.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
---
2-
title: Component Registration
2+
title: Registrasi Komponen
33
type: guide
44
order: 101
55
---
66

7-
> This page assumes you've already read the [Components Basics](components.html). Read that first if you are new to components.
7+
> Halaman ini berasumsi Anda telah membaca [Komponen Dasar](components.html). Baca halaman itu terlebih dahulu bila Anda belum mengerti komponen.
88
9-
## Component Names
9+
## Nama Komponen
1010

11-
When registering a component, it will always be given a name. For example, in the global registration we've seen so far:
11+
Ketika mendaftarkan sebuah komponen, selalu berikan nama. Misalnya, untuk sebuah registrasi global kita akan melihat seperti berikut:
1212

1313
```js
1414
Vue.component('my-component-name', { /* ... */ })
1515
```
1616

17-
The component's name is the first argument of `Vue.component`.
17+
Nama komponen adalah argumen pertama dari `Vue.component`.
1818

19-
The name you give a component may depend on where you intend to use it. When using a component directly in the DOM (as opposed to in a string template or [single-file component](single-file-components.html)), we strongly recommend following the [W3C rules](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) for custom tag names (all-lowercase, must contain a hyphen). This helps you avoid conflicts with current and future HTML elements.
19+
Nama yang Anda berikan ke komponen mungkin tergantung pada dimana Anda akan menggunakannya. Ketika menggunakan komponen secara langsung di dalam DOM ( sebagai lawan di dalam *template string* atau [berkas komponen tunggal *(single-file component)*](single-file-components.html)), kita sangat merekomendasikan untuk mengikuti [Panduan W3C](https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name) untuk membuat nama tag *custom* (semuanya huruf kecil, harus berisi tAnda penghubung). Ini membantu Anda untuk menghindari konflik dengan elemen HTML sekarang dan kedepanya.
2020

21-
You can see other recommendations for component names in the [Style Guide](../style-guide/#Base-component-names-strongly-recommended).
21+
Anda bisa melihat rekomendasi lainya untuk nama nama komponen di [Panduan Gaya](../style-guide/#Base-component-names-strongly-recommended).
2222

23-
### Name Casing
23+
### Bingkai Nama (Name Casing)
2424

25-
You have two options when defining component names:
25+
Anda mempunyai dua pilihan ketika mendefinisikan nama komponen:
2626

27-
#### With kebab-case
27+
#### Dengan *kebab-case*
2828

2929
```js
30-
Vue.component('my-component-name', { /* ... */ })
30+
Vue.component('nama-komponen-saya', { /* ... */ })
3131
```
3232

33-
When defining a component with kebab-case, you must also use kebab-case when referencing its custom element, such as in `<my-component-name>`.
33+
Ketika mendefinisikan komponen dengan *kebab-case*, Anda juga harus menggunakan *kebab-case* ketika memberi referensi ke elemen *custom*, seperti di `<nama-komponen-saya>`.
3434

35-
#### With PascalCase
35+
#### Dengan *PascalCase*
3636

3737
```js
38-
Vue.component('MyComponentName', { /* ... */ })
38+
Vue.component('NamaKomponenSaya', { /* ... */ })
3939
```
4040

41-
When defining a component with PascalCase, you can use either case when referencing its custom element. That means both `<my-component-name>` and `<MyComponentName>` are acceptable. Note, however, that only kebab-case names are valid directly in the DOM (i.e. non-string templates).
41+
Ketika mendefinisikan komponen dengan *PascalCase*, Anda dapat menggunakan kedua hal ketika memberi referensi ke *custom* elemenya. Itu berarti, kedua `<nama-komponen-saya>` dan `<NamaKomponenSaya>` dapat diterima. Catatan, meskipun hanya nama *kebab-case* yang valid secara langsung di DOM (contoh : *templates non-string*).
4242

43-
## Global Registration
43+
## Registrasi Global
4444

45-
So far, we've only created components using `Vue.component`:
45+
Sejauh ini, kita hanya membuat komponen menggunakan `Vue.component`:
4646

4747
```js
48-
Vue.component('my-component-name', {
49-
// ... options ...
48+
Vue.component('nama-komponen-saya', {
49+
// ... pilihan ...
5050
})
5151
```
5252

53-
These components are **globally registered**. That means they can be used in the template of any root Vue instance (`new Vue`) created after registration. For example:
53+
Komponen ini **teregistrasi secara global**. Itu berarti mereka dapat digunakan di dalam *template* dari semua *root Vue Instance* (`new Vue`) dibuat setelah diregistrasi. Sebagai contoh:
5454

5555
```js
5656
Vue.component('component-a', { /* ... */ })
@@ -68,21 +68,21 @@ new Vue({ el: '#app' })
6868
</div>
6969
```
7070

71-
This even applies to all subcomponents, meaning all three of these components will also be available _inside each other_.
71+
Ini bahkan berlaku kepada semua sub komponen, berarti tiga komponen tersebut juga tersedia _di dalam satu sama lain_.
7272

73-
## Local Registration
73+
## Registrasi Lokal
7474

75-
Global registration often isn't ideal. For example, if you're using a build system like Webpack, globally registering all components means that even if you stop using a component, it could still be included in your final build. This unnecessarily increases the amount of JavaScript your users have to download.
75+
Registrasi global jarang menjadi ideal. Sebagai contoh, ketika Anda menggunakan *build system* seperti Webpack, meregistrasi global semua komponen berarti ketika Anda berhenti menggunakan sebuah komponen, itu juga masih termasuk di *final build* Anda. Ketidakperluan ini menambah banyak Javascript yang harus di unduh oleh pengguna Anda.
7676

77-
In these cases, you can define your components as plain JavaScript objects:
77+
Pada kasus ini, Anda bisa menetapkan komponen Anda sebagai objek Javascript sederhana:
7878

7979
```js
8080
var ComponentA = { /* ... */ }
8181
var ComponentB = { /* ... */ }
8282
var ComponentC = { /* ... */ }
8383
```
8484

85-
Then define the components you'd like to use in a `components` option:
85+
Lalu tetapkan komponen komponen yang akan Anda gunakan di opsi `komponen`
8686

8787
```js
8888
new Vue({
@@ -94,9 +94,9 @@ new Vue({
9494
})
9595
```
9696

97-
For each property in the `components` object, the key will be the name of the custom element, while the value will contain the options object for the component.
97+
Untuk setiap properti di dalam objek `components`, kuncinya akan menjadi nama dari elemen *custom*, ketika nilai akan berisi pilihan objek dari komponen tersebut.
9898

99-
Note that **locally registered components are _not_ also available in subcomponents**. For example, if you wanted `ComponentA` to be available in `ComponentB`, you'd have to use:
99+
Catat bahwa **komponen yang terdaftar secara lokal juga _tidak_ terdapat di dalam _sub komponen_**. Sebagai contoh, jika Anda ingin `Component A` terdapat di dalam `Component B`, Anda harus menggunakan:
100100

101101
```js
102102
var ComponentA = { /* ... */ }
@@ -109,7 +109,7 @@ var ComponentB = {
109109
}
110110
```
111111

112-
Or if you're using ES2015 modules, such as through Babel and Webpack, that might look more like:
112+
Atau jika Anda menggunakan modul ES2015, seperti menggunakan Babel dan Webpack, itu akan lebih terlihat seperti:
113113

114114
```js
115115
import ComponentA from './ComponentA.vue'
@@ -122,20 +122,20 @@ export default {
122122
}
123123
```
124124

125-
Note that in ES2015+, placing a variable name like `ComponentA` inside an object is shorthand for `ComponentA: ComponentA`, meaning the name of the variable is both:
125+
Catat bahwa di ES2015+, menempatkan nama variabel seperti `ComponentA` di dalam *shorthand* objek untuk`ComponentA: ComponentA`, berarti nama dari kedua variabel adalah:
126126

127-
- the custom element name to use in the template, and
128-
- the name of the variable containing the component options
127+
- nama elemen *custom* yang digunakan di *template*, dan
128+
- nama dari variabel berisi pilihan komponen
129129

130-
## Module Systems
130+
## Sistem Modul
131131

132-
If you're not using a module system with `import`/`require`, you can probably skip this section for now. If you are, we have some special instructions and tips just for you.
132+
Ketika Anda tidak menggunakan sistem modul dengan `import`/`require`, Anda mungkin bisa melewati bagian ini untuk sekarang. Jika Anda menggunakanya, kita punya beberapa arahan spesial dan tips khusus untukmu.
133133

134-
### Local Registration in a Module System
134+
### Registrasi Lokal di dalam Sistem Modul
135135

136-
If you're still here, then it's likely you're using a module system, such as with Babel and Webpack. In these cases, we recommend creating a `components` directory, with each component in its own file.
136+
Jika Anda masih disini, berarti sepertinya Anda menggunakan sistem modul, seperti Babel dan Webpack. Pada kasus ini, kita merekomendasi membuat sebuah direktori `komponen`, dengan setiap komponen memiliki filenya sendiri.
137137

138-
Then you'll need to import each component you'd like to use, before you locally register it. For example, in a hypothetical `ComponentB.js` or `ComponentB.vue` file:
138+
Lalu Anda harus memasukan setiap komponen yang akan Anda gunakan, sebelum Anda mendaftarkanya secara lokal. Sebagai contoh, di sebuah *hypothetical* `ComponentB.js` atau `ComponentB.vue` file:
139139

140140
```js
141141
import ComponentA from './ComponentA'
@@ -150,13 +150,13 @@ export default {
150150
}
151151
```
152152

153-
Now both `ComponentA` and `ComponentC` can be used inside `ComponentB`'s template.
153+
Sekarang kedua `ComponentA` Dan `ComponentC` dapat digunakan di dalam *template* `ComponentB`.
154154

155-
### Automatic Global Registration of Base Components
155+
### Registrasi Otomatis Global dari Komponen Dasar
156156

157-
Many of your components will be relatively generic, possibly only wrapping an element like an input or a button. We sometimes refer to these as [base components](../style-guide/#Base-component-names-strongly-recommended) and they tend to be used very frequently across your components.
157+
Banyak dari komponen Anda akan generik secara relatif, mungkin hanya membungkus elemen seperti sebuah tombol atau *input*. Kita terkadang mengacu pada ini sebagai [komponen dasar](../style-guide/#Base-component-names-strongly-recommended) dan mereka cenderung sering digunakan di beberapa komponen Anda.
158158

159-
The result is that many components may include long lists of base components:
159+
Hasilnya adalah banyak komponen mungkin memasukan daftar panjang dari komponen dasar:
160160

161161
```js
162162
import BaseButton from './BaseButton.vue'
@@ -172,7 +172,7 @@ export default {
172172
}
173173
```
174174

175-
Just to support relatively little markup in a template:
175+
Hanya untuk membantu sedikit *markup* yang sama di sebuah *template*:
176176

177177
```html
178178
<BaseInput
@@ -184,7 +184,7 @@ Just to support relatively little markup in a template:
184184
</BaseButton>
185185
```
186186

187-
Fortunately, if you're using Webpack (or [Vue CLI 3+](https://github.com/vuejs/vue-cli), which uses Webpack internally), you can use `require.context` to globally register only these very common base components. Here's an example of the code you might use to globally import base components in your app's entry file (e.g. `src/main.js`):
187+
Untungnya, jika Anda menggunakan Webpack (atau [Vue CLI 3+](https://github.com/vuejs/vue-cli), yang menggunakan Webpack di dalamnya), Anda bisa menggunakan `require.context` untuk mendaftarkan secara global komponen dasar yang paling umum. Berikut ini adalah contoh dari kode yang mungkin Anda gunakan secara global untuk memasukan komponen dasar di awalan file aplikasi milik Anda (contohnya `src/main.js`):
188188

189189
```js
190190
import Vue from 'vue'
@@ -227,4 +227,4 @@ requireComponent.keys().forEach(fileName => {
227227
})
228228
```
229229

230-
Remember that **global registration must take place before the root Vue instance is created (with `new Vue`)**. [Here's an example](https://github.com/chrisvfritz/vue-enterprise-boilerplate/blob/master/src/components/_globals.js) of this pattern in a real project context.
230+
Harap diingat bahsaw **pendaftaran global harus terjadi sebelum _root instance Vue_ dibuat (dengan `new Vue`)**. [ Berikut contohnya](https://github.com/chrisvfritz/vue-enterprise-boilerplate/blob/master/src/components/_globals.js) dari pola ini di dalam konteks proyek sungguhan.

0 commit comments

Comments
 (0)