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
Berikut adalah ringkasan singkat tentang apa yang telah berubah:
11
11
12
-
-**BREAKING**: Using numbers, i.e. keyCodes, as `v-on`modifiers is no longer supported
13
-
-**BREAKING**: `config.keyCodes`is no longer supported
12
+
-**MERUSAK**: Pengunaan angka-angka, contoh. keyCodes, sebagai pengubah `v-on`tidak lagi didukung
13
+
-**MERUSAK**: `config.keyCodes`tidak lagi didukung
14
14
15
-
## 2.x Syntax
15
+
## 2.x Sintaksis
16
16
17
-
In Vue 2, `keyCodes`were supported as a way to modify a`v-on` method.
17
+
Pada Vue 2, `keyCodes`didukung sebagai satu cara untuk mengubah suatu metode`v-on`.
18
18
19
19
```html
20
-
<!--keyCode version-->
20
+
<!--versi keyCode-->
21
21
<inputv-on:keyup.13="submit" />
22
22
23
-
<!--alias version-->
23
+
<!--versi alias-->
24
24
<inputv-on:keyup.enter="submit" />
25
25
```
26
26
27
-
In addition, you could define your own aliases via the global `config.keyCodes` option.
27
+
Tambahan, Anda dapat mendefinisikan alias Anda sendiri melalui opsi global `config.keyCodes`.
28
28
29
29
```js
30
30
Vue.config.keyCodes= {
@@ -33,40 +33,40 @@ Vue.config.keyCodes = {
33
33
```
34
34
35
35
```html
36
-
<!--keyCode version-->
36
+
<!--versi keyCode-->
37
37
<inputv-on:keyup.112="showHelpText" />
38
38
39
-
<!--custom alias version-->
39
+
<!--versi alias kustom-->
40
40
<inputv-on:keyup.f1="showHelpText" />
41
41
```
42
42
43
-
## 3.x Syntax
43
+
## 3.x Sintaksis
44
44
45
-
Since[`KeyboardEvent.keyCode`has been deprecated](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode), it no longer makes sense for Vue 3 to continue supporting this as well. As a result, it is now recommended to use the kebab-case name for any key you want to use as a modifier.
45
+
Dikarenakan[`KeyboardEvent.keyCode`telah usang](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode), sangat tidak masuk akal jika Vue 3 tetap mendukung hal ini. Sebagai gantinya, direkomendasikan untuk penggunaan nama kebab-case untuk semua key yang Anda akan gunakan sebagai pengubah.
46
46
47
47
```html
48
-
<!-- Vue 3 Key Modifier on v-on -->
48
+
<!--Pengubah Vue 3 Key pada v-on -->
49
49
<inputv-on:keyup.page-down="nextPage">
50
50
51
-
<!--Matches both q and Q-->
51
+
<!--kedua q dan Q cocok-->
52
52
<inputv-on:keypress.q="quit">
53
53
```
54
54
55
-
As a result, this means that `config.keyCodes`is now also deprecated and will no longer be supported.
55
+
Hasilnya, hal ini berarti bahwa `config.keyCodes`juga telah usang dan tidak lagi didukung.
56
56
57
-
## Migration Strategy
57
+
## Strategi dalam Migrasi
58
58
59
-
For those using `keyCode`in their codebase, we recommend converting them to their kebab-cased named equivalents.
59
+
Untuk semua yang memakai `keyCode`pada codebase kalian, kami merekomendasikan pengubahaan `keyCode` menjadi penamaan kebab-cased yang setara.
60
60
61
-
The keys for some punctuation marks can just be included literally. e.g. For the`,` key:
61
+
keys sebagai tanda baca dapat dituliskan secara literal. contoh. untuk key`,`:
62
62
63
63
```html
64
64
<inputv-on:keypress.,="commaPress">
65
65
```
66
66
67
-
Limitations of the syntax prevent certain characters from being matched, such as `"`, `'`, `/`, `=`, `>`, and`.`. For those characters you should check `event.key`inside the listener instead.
67
+
Limitasi dari sintaksis mencegah beberapa karakter untuk dicocokan, seperti `"`, `'`, `/`, `=`, `>`, dan`.`. Sebagai gantinya, untuk karakter-karakter tersebut Anda dapat cek `event.key`di dalam listener.
The`$listeners`object has been removed in Vue 3. Event listeners are now part of`$attrs`:
11
+
Objek`$listeners`telah dihapuskan pada Vue 3. Event listeners sekarang bagian dari`$attrs`:
12
12
13
13
```js
14
14
{
@@ -17,10 +17,10 @@ The `$listeners` object has been removed in Vue 3. Event listeners are now part
17
17
}
18
18
```
19
19
20
-
## 2.x Syntax
20
+
## 2.x Sintaksis
21
21
22
-
In Vue 2, you can access attributes passed to your components with `this.$attrs`, and event listeners with`this.$listeners`.
23
-
In combination with `inheritAttrs: false`, they allow the developer to apply these attributes and listeners to some other element instead of the root element:
22
+
Pada Vue 2, Anda dapat mengakses atribut-atribut yang disuguhkan ke komponen-komponen Anda melalui `this.$attrs`, dan event listeners dengan`this.$listeners`.
23
+
Pengkombinasian dengan `inheritAttrs: false`, mereka membolehkan para pengembang untuk mengaplikasikan atribut-atribut dan listener-listener ini ke semua elemen lain daripada ke elemen root:
24
24
25
25
```html
26
26
<template>
@@ -35,9 +35,9 @@ In combination with `inheritAttrs: false`, they allow the developer to apply the
35
35
</script>
36
36
```
37
37
38
-
## 3.x Syntax
38
+
## 3.x Sintaksis
39
39
40
-
In Vue 3's virtual DOM, event listeners are now just attributes, prefixed with`on`, and as such are part of the `$attrs` object, so`$listeners`has been removed.
40
+
Pada Vue 3's virtual DOM, event listeners sekarang hanyalah sebuah atribut, diawali dengan`on`, dan merupakan bagian dari objek `$attrs`, sehingga`$listeners`telah dihapuskan.
41
41
42
42
```vue
43
43
<template>
@@ -52,7 +52,7 @@ export default {
52
52
</script>
53
53
```
54
54
55
-
If this component received an `id`attribute and a`v-on:close` listener, the`$attrs`object will now look like this:
55
+
jika komponen ini mendapatkan sebuah atribut `id`dan sebuah listener`v-on:close`, objek`$attrs`sekarang akan tampak seperti ini:
56
56
57
57
```js
58
58
{
@@ -61,16 +61,16 @@ If this component received an `id` attribute and a `v-on:close` listener, the `$
0 commit comments