-
Notifications
You must be signed in to change notification settings - Fork 90
Translate bahasa indonesia dari : Vue Computed Property & Watcher #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/v2/guide/computed.md
Outdated
@@ -1,60 +1,61 @@ | |||
--- | |||
title: Computed Properties and Watchers | |||
title: Pengamat dan properti penghitung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tetep tambahin aslinya mas, Properti Penghitung (Computed) dan Pengamat (Watchers)
src/v2/guide/computed.md
Outdated
type: guide | ||
order: 5 | ||
--- | ||
|
||
## Computed Properties | ||
## Properti Penghitung (Computed Properties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yang dikurung cukup computed aja.
Properti sudah cukup familiar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tapi sebenarnya sudah gak perlu lagi, karena di title kita sudah kasih tau yang kita maksud adalah computed.
Jadi bisa pakai Properti Penghitung tanpa kurung lagi
src/v2/guide/computed.md
Outdated
## Computed Properties | ||
## Properti Penghitung (Computed Properties) | ||
|
||
Pernyataan *In-template* sangatlah mudah, tapi mereka dibuat untuk operasi yang sederhana. Memberikan terlalu banyak logika di *template* anda dapat menyebabkan mereka berat dan susah untuk dipelihara. Sebagai Contoh : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tapi mereka -> tapi hal tersebut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dapat menyebabkan mereka berat -> dapat menyebabkan menjadi berat
|
||
``` html | ||
<div id="example"> | ||
{{ message.split('').reverse().join('') }} | ||
</div> | ||
``` | ||
|
||
At this point, the template is no longer simple and declarative. You have to look at it for a second before realizing that it displays `message` in reverse. The problem is made worse when you want to include the reversed message in your template more than once. | ||
Pada poin ini, *template* tidak lagi sederhana dan deklaratif. Anda harus melihat itu untuk beberapa saat sebelum menyadari bahwa itu menampilkan *`message`* secara terbalik. Masalahnya diperburuk ketika anda ingin memasukan pesan terbalik itu kedalam *template* anda lebih dari sekali. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ganti anda jadi Anda
src/v2/guide/computed.md
Outdated
|
||
That's why for any complex logic, you should use a **computed property**. | ||
Itulah kenapa, untuk logika yang kompleks, anda harus menggunakan **properti penghitung**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Koma disini jadi gak cocok.
Kenapa diganti dengan mengapa
src/v2/guide/computed.md
Outdated
|
||
You can data-bind to computed properties in templates just like a normal property. Vue is aware that `vm.reversedMessage` depends on `vm.message`, so it will update any bindings that depend on `vm.reversedMessage` when `vm.message` changes. And the best part is that we've created this dependency relationship declaratively: the computed getter function has no side effects, which makes it easier to test and understand. | ||
Anda bisa melakukan *data-bind* ke properti penghitung di *template* seperti properti normal. Vue sadar bahwa `vm.reversedMessage` tergantung dengan `vm.message`, jadi itu akan merubah semua yang terkait dengan `vm.reversedMessage` ketika `vm.message` berubah. Dan bagian terbaiknya adalah kita telah membuat hubungan *dependency* secara deklaratif : penghitung fungsi *getter* tidak mempunyai efek samping, yang membuat itu menjadi lebih mudah untuk di coba dan di pahami. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
di coba -> dicoba
di pahami -> dipahami
src/v2/guide/computed.md
Outdated
methods: { | ||
reverseMessage: function () { | ||
return this.message.split('').reverse().join('') | ||
} | ||
} | ||
``` | ||
|
||
Instead of a computed property, we can define the same function as a method instead. For the end result, the two approaches are indeed exactly the same. However, the difference is that **computed properties are cached based on their dependencies.** A computed property will only re-evaluate when some of its dependencies have changed. This means as long as `message` has not changed, multiple access to the `reversedMessage` computed property will immediately return the previously computed result without having to run the function again. | ||
Selain properti penghitung, kita dapat menetapkan fungsi yang sama sebagai metode. Untuk hasil akhirnya, dua pendekatan memang sama persis. Tetapi, perbedaanya adalah **properti penghitung *(computed property)* di simpan berdasarkan *dependencies* mereka.** Sebuah properti penghitung hanya akan mengevaluasi ulang ketika salah satu *dependencies* mereka telah berubah. Ini berarti selama `message` belum berubah, semua akses ke `reversedMessage` properti penghitung akan langsung kembali ke hasil penghitungan sebelumnya tanpa harus menjalankan ulang fungsi tersebut |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sudah gak perlu dijelaskan pakai (computed property)
src/v2/guide/computed.md
Outdated
|
||
### Computed vs Watched Property | ||
### Properti Penghitung (Computed Property) vs Properti Pengawas (Watched Property) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ini juga udah gak perlu kurung lagi
Udah beres ya mas @iqbalaqaba ? Saya merge ya |
Mantap mas @mazipan thank you 😄 |
Hasil translate bahasa indonesia dari : Vue Computed Property & Watcher 🚀