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
<p class="tip">All lifecycle hooks automatically have their `this` context bound to the instance, so that you can access data, computed properties, and methods. This means __you should not use an arrow function to define a lifecycle method__ (e.g. `created: () => this.fetchTodos()`). The reason is arrow functions bind the parent context, so `this` will not be the Vue instance as you expect and `this.fetchTodos` will be undefined.</p>
797
+
<p class="tip">Semua kait siklus hidup secara otomatis terikat konteks `this` dengan *instance*, sehingga Anda bisa mengakses data, computed properties, dan methods. Ini berarti __Anda seharusnya tidak menggunakan *arrow function* saat mendefinisikan metode siklus hidup__ (e.g. `created: () => this.fetchTodos()`). Alasannya adalah *arrow function* mengikat konteks induk, jadi `this` tidak akan menjadi *instance* Vue seperti yang Anda harapkan dan `this.fetchTodos` akan undefined.</p>
798
798
799
799
### beforeCreate
800
800
801
801
- **Tipe:** `Function`
802
802
803
803
- **Detail:**
804
804
805
-
Called synchronously immediately after the instance has been initialized, before data observation and event/watcher setup.
805
+
Dipanggil secara sinkron segera setelah *instance* diinisialisasi, sebelum pengaturan data observasi dan *event/watcher*.
Called synchronously after the instance is created. At this stage, the instance has finished processing the options which means the following have been set up: data observation, computed properties, methods, watch/event callbacks. However, the mounting phase has not been started, and the `$el` property will not be available yet.
815
+
Dipanggil secara sinkron setelah *instance* dibuat. Pada tahap ini, *instance* telah selesai memproses opsi yang berarti yang berikut telah diatur: data observasi, *computed properties*, *methods*, *watch/event callbacks*. Namun, tahap pemasangan belum dimulai, dan properti `$el` belum tersedia.
Called after the instance has been mounted, where `el` is replaced by the newly created `vm.$el`. If the root instance is mounted to an in-document element, `vm.$el` will also be in-document when `mounted` is called.
837
+
Dipanggil setelah *instance* telah terpasang, dimana `el` digantikan oleh `vm.$el` yang baru dibuat. Jika root instance sudah terpasang ke sebuah elemen pada dokumen, `vm.$el` juga akan di dokumen ketika `mounted` dipanggil.
838
+
839
+
Perhatikan bahwa `mounted` tidak menjamin bahwa semua komponen turunannya telah terpasang. Jika Anda ingin menunggu hingga seluruh tampilan telah di-*rander*, anda dapat menggunakan [vm.$nextTick](#vm-nextTick) di dalam `mounted`
838
840
839
-
Note that `mounted` does **not** guarantee that all child components have also been mounted. If you want to wait until the entire view has been rendered, you can use [vm.$nextTick](#vm-nextTick) inside of `mounted`:
840
841
841
842
``` js
842
843
mounted: function () {
843
844
this.$nextTick(function () {
844
-
//Code that will run only after the
845
-
//entire view has been rendered
845
+
//Kode yang hanya akan berjalan setelah
846
+
//seluruh tampilan telah di-render
846
847
})
847
848
}
848
849
```
849
850
850
-
**This hook is not called during server-side rendering.**
851
+
**Kait ini tidak dipanggil selama *rendering* di sisi server.**
Called when data changes, before the DOM is patched. This is a good place to access the existing DOM before an update, e.g. to remove manually added event listeners.
861
+
Dipanggil ketika data berubah sebelum DOM di-*patched*. Ini adalah tempat yang baik untuk mengakses DOM yang ada sebelum pembaruan, misalnya untuk menghapus *event listeners* yang ditambahkan secara manual.
861
862
862
-
**This hook is not called during server-side rendering, because only the initial render is performed server-side.**
863
+
**Kait ini tidak dipanggil selama *rendering* di sisi server, karena hanya render awal yang dilakukan di sisi server.**
Called after a data change causes the virtual DOM to be re-rendered and patched.
873
+
Dipanggil setelah perubahan data menyebabkan *virtual DOM* diubah dan *patched*.
873
874
874
-
The component's DOM will have been updated when this hook is called, so you can perform DOM-dependent operations here. However, in most cases you should avoid changing state inside the hook. To react to state changes, it's usually better to use a [computed property](#computed) or [watcher](#watch) instead.
875
+
*DOM* komponen akan diperbarui ketika kait ini dipanggil, sehingga Anda dapat melakukan operasi yang bergantung pada *DOM* di sini. Namun, dalam sebagian besar kasus, Anda harus menghindari perubahan *state* di dalam kait. Untuk bereaksi terhadap perubahan *state*, biasanya lebih baik menggunakan [computed property](#computed) atau [watcher](#watch).
875
876
876
-
Note that`updated`does **not** guarantee that all child components have also been re-rendered. If you want to wait until the entire view has been re-rendered, you can use [vm.$nextTick](#vm-nextTick) inside of `updated`:
877
+
Perhatikan bahwa`updated`tidak menjamin bahawa semua komponen turunannya telah terpasang. Jika Anda ingin menunggu hingga seluruh tampilan telah di-*render*, anda dapat menggunakan [vm.$nextTick](#vm-nextTick) di dalam `mounted`
877
878
878
879
``` js
879
880
updated:function () {
880
881
this.$nextTick(function () {
881
-
//Code that will run only after the
882
-
//entire view has been re-rendered
882
+
//Kode yang hanya akan berjalan setelah
883
+
//seluruh tampilan telah di-render
883
884
})
884
885
}
885
886
```
886
887
887
-
**This hook is not called during server-side rendering.**
888
+
**Kait ini tidak dipanggil selama *rendering* di sisi server.**
Called after a Vue instance has been destroyed. When this hook is called, all directives of the Vue instance have been unbound, all event listeners have been removed, and all child Vue instances have also been destroyed.
938
+
Dipanggil setelah *instance* Vue dihancurkan. Ketika kait ini dipanggil, semua *directives* dari *instance* Vue *unbound*, semua *event listeners* telah dihapus, dan semua turunan *instance* Vue juga telah dihancurkan.
938
939
939
-
**This hook is not called during server-side rendering.**
940
+
**Kait ini tidak dipanggil selama *rendering* di sisi server.**
Called when an error from any descendent component is captured. The hook receives three arguments: the error, the component instance that triggered the error, and a string containing information on where the error was captured. The hook can return `false`to stop the error from propagating further.
952
+
Dipanggil ketika galat dari komponen turunan ditangkap. Kait menerima tiga argumen: Galatnya, *instance* komponen yang memicu galat, dan *string* yang memuat informasi dimana galat itu tertangkap. Kait dapat mengembalikan `false`untuk menghentikan galat agar tidak menyebar lebih lanjut.
952
953
953
-
<p class="tip">You can modify component state in this hook. However, it is important to have conditionals in your template or render function that short circuits other content when an error has been captured; otherwise the component will be thrown into an infinite render loop.</p>
954
+
<p class="tip">Anda dapat mengubah state komponen dalam kait ini. Namun, penting untuk memiliki persyaratan dalam templat Anda atau fungsi *render* yang memiliki sirkuit pendek konten lain ketika galat telah ditangkap; jika tidak, komponen akan dilemparkan ke *loop render* yang tak terbatas.</p>
954
955
955
-
**Error Propagation Rules**
956
+
**Aturan Propagasi Galat**
956
957
957
-
- By default, all errors are still sent to the global `config.errorHandler`if it is defined, so that these errors can still be reported to an analytics service in a single place.
958
+
- Secara *default*, semua kesalahan masih dikirim ke `config.errorHandler`global jika sudah didefinisikan, sehingga galat ini masih dapat dilaporkan ke layanan analitik di satu tempat.
958
959
959
-
- If multiple `errorCaptured`hooks exist on a component's inheritance chain or parent chain, all of them will be invoked on the same error.
960
+
- Jika ada beberapa kait `errorCaptured`pada rantai pewarisan atau rantai induk komponen, semuanya akan dipanggil pada kesalahan yang sama.
960
961
961
-
- If the`errorCaptured`hook itself throws an error, both this error and the original captured error are sent to the global `config.errorHandler`.
962
+
- Jika kait`errorCaptured`itu sendiri melempar kesalahan, kesalahan ini dan kesalahan yang ditangkap asli dikirim ke `config.errorHandler` global.
962
963
963
-
- An`errorCaptured`hook can return `false`to prevent the error from propagating further. This is essentially saying "this error has been handled and should be ignored." It will prevent any additional `errorCaptured`hooks or the global `config.errorHandler`from being invoked for this error.
964
+
- Kait`errorCaptured`dapat mengembalikan `false`untuk mencegah kesalahan agar tidak menyebar lebih lanjut. Ini pada dasarnya mengatakan "kesalahan ini telah ditangani dan harus diabaikan." Ini akan mencegah kait `errorCaptured`tambahan atau `globalconfig.errorHandler`global agar tidak dipanggil untuk kesalahan ini.
0 commit comments