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
Copy file name to clipboardExpand all lines: src/v2/guide/transitioning-state.md
+34-36Lines changed: 34 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,20 @@
1
1
---
2
-
title: State Transitions
2
+
title: Transisi State
3
3
type: guide
4
4
order: 202
5
5
---
6
6
7
-
Vue's transition system offers many simple ways to animate entering, leaving, and lists, but what about animating your data itself? For example:
7
+
Terdapat banyak cara sederhana pada sistem transisi Vue untuk animasi masuk, keluar dan daftar, tetapi bagaimana dengan menganimasi data Anda sendiri? Sebagai contoh:
8
+
- angka dan kalkulasi
9
+
- warna yang ditampilkan
10
+
- posisi node SVG
11
+
- ukuran dan properti lain dari elemen
8
12
9
-
- numbers and calculations
10
-
- colors displayed
11
-
- the positions of SVG nodes
12
-
- the sizes and other properties of elements
13
+
Semuanya ini bisa saja sudah disimpan sebagai angka mentah (*raw number*) atau belum dikonversi menjadi angka. Ketika kita melakukan hal itu, kita dapat menganimasi perubahan *state* ini menggunakan pustaka pihak ketiga menjadi *tween state*, dalam kombinasi dengan reaktivitas Vue dan sistem komponennya.
13
14
14
-
All of these are either already stored as raw numbers or can be converted into numbers. Once we do that, we can animate these state changes using 3rd-party libraries to tween state, in combination with Vue's reactivity and component systems.
15
+
## Menganimasi *State* Menggunakan *Watcher*
15
16
16
-
## Animating State with Watchers
17
-
18
-
Watchers allow us to animate changes of any numerical property into another property. That may sound complicated in the abstract, so let's dive into an example using [GreenSock](https://greensock.com/):
17
+
Dengan menggunakan *watcher*, kita dapat menganimasi perubahan dari properti numerik apapun menjadi properti lain. Hal tersebut terkesan rumit untuk dibayangkan, jadi mari kita pahami contoh berikut menggunakan [GreenSock](https://greensock.com/):
When you update the number, the change is animated below the input. This makes for a nice demo, but what about something that isn't directly stored as a number, like any valid CSS color for example? Here's how we could accomplish this with [Tween.js](https://github.com/tweenjs/tween.js)and[Color.js](https://github.com/brehaut/color-js):
75
+
Ketika Anda mengubah angka, perubahannya dianimasi di bawah input. Ini demo yang baik, tetapi bagaimana dengan sesuatu yang tidak secara langsung disimpan sebagai angka, seperti warna valid CSS sebagai contoh? Berikut ini adalah bagaimana kita dapat menyelesaikannya menggunakan [Tween.js](https://github.com/tweenjs/tween.js)dan[Color.js](https://github.com/brehaut/color-js):
As with Vue's transition components, the data backing state transitions can be updated in real time, which is especially useful for prototyping! Even using a simple SVG polygon, you can achieve many effects that would be difficult to conceive of until you've played with the variables a little.
235
+
Sebagaimana dengan transisi komponen Vue, data yang mendukung transisi *state* dapat diubah secara waktu nyata (*real time*), yang mana secara khusus berguna untuk membuat prototipe! Meskipun hanya menggunakan poligon SVG sederhana, Anda dapat memperoleh banyak efek yang sulit untuk dihasilkan sampai Anda sedikit bermain dengan variabel.
@@ -366,11 +365,11 @@ function generatePoints (stats) {
366
365
</style>
367
366
{% endraw %}
368
367
369
-
See [this fiddle](https://jsfiddle.net/chrisvfritz/65gLu2b6/)for the complete code behind the above demo.
368
+
Lihat [*fiddle* ini](https://jsfiddle.net/chrisvfritz/65gLu2b6/)untuk kode selengkapnya dari demo di atas.
370
369
371
-
## Organizing Transitions into Components
370
+
## Mengatur Transisi dalam Komponen
372
371
373
-
Managing many state transitions can quickly increase the complexity of a Vue instance or component. Fortunately, many animations can be extracted out into dedicated child components. Let's do this with the animated integer from our earlier example:
372
+
Mengelola banyak transisi *state* dapat menambah kerumitan dari sebuah *instance* atau komponen Vue secara singkat. Beruntung, banyak animasi dapat dikeluarkan ke suatu anak komponen yang telah didedikasikan. Mari kita melakukannya dengan animasi *integer* dari contoh sebelumnya:
//All complexity has now been removed from the main Vue instance!
436
+
//Semua kerumitan telah dihilangkan dari instance utama Vue!
439
437
newVue({
440
438
el:'#example-8',
441
439
data: {
@@ -519,15 +517,15 @@ new Vue({
519
517
</script>
520
518
{% endraw %}
521
519
522
-
Within child components, we can use any combination of transition strategies that have been covered on this page, along with those offered by Vue's [built-in transition system](transitions.html). Together, there are very few limits to what can be accomplished.
520
+
Dalam anak komponen, kita dapat menggunakan kombinasi strategi transisi apapun yang telah tercakup pada halaman ini, bersama dengan yang ditawarkan oleh [sistem transisi *built-in* Vue](transitions.html). Dengan demikian, batasan menjadi minim dari apa yang bisa diperoleh.
523
521
524
-
## Bringing Designs to Life
522
+
## Menghidupkan Desain
525
523
526
-
To animate, by one definition, means to bring to life. Unfortunately, when designers create icons, logos, and mascots, they're usually delivered as images or static SVGs. So although GitHub's octocat, Twitter's bird, and many other logos resemble living creatures, they don't really seem alive.
524
+
Menganimasi dapat didefinisikan sebagai memberi kehidupan. Sayang sekali, ketika desainer membuat ikon, logo, dan maskot, mereka biasanya menyerahkannya dalam bentuk gambar atau SVG statis. Jadi meskipun *octocat* Github, burung Twitter, dan banyak logo lain menyerupai makhluk hidup, mereka tidak terkesan sungguh-sungguh hidup.
527
525
528
-
Vue can help. Since SVGs are just data, we only need examples of what these creatures look like when excited, thinking, or alarmed. Then Vue can help transition between these states, making your welcome pages, loading indicators, and notifications more emotionally compelling.
526
+
Vue dapat membantu dalam hal ini. Karena SVG hanyalah data, kita cukup memerlukan contoh seperti apa makhluk-makhluk tersebut ketika gembira, berpikir, atau khawatir. Setelah itu, Vue dapat membantu transisi antar *state*-nya, membuat halaman selamat datang, memuat indikator-indikator, dan notifikasi menjadi lebih menarik secara emosional.
529
527
530
-
Sarah Drasner demonstrates this in the demo below, using a combination of timed and interactivity-driven state changes:
528
+
Sarah Drasner menunjukannya dalam demo di bawah ini, menggunakan sebuah kombinasi dari perubahan *timed* dan *interactivity-driven state*:
531
529
532
530
<pdata-height="265"data-theme-id="light"data-slug-hash="YZBGNp"data-default-tab="result"data-user="sdras"data-embed-version="2"data-pen-title="Vue-controlled Wall-E"class="codepen">See the Pen <ahref="https://codepen.io/sdras/pen/YZBGNp/">Vue-controlled Wall-E</a> by Sarah Drasner (<ahref="https://codepen.io/sdras">@sdras</a>) on <ahref="https://codepen.io">CodePen</a>.</p>
0 commit comments