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/guide/transitioning-state.md
+144-7Lines changed: 144 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
-
title: State Transitions
2
+
title: Transitioning State
3
3
type: guide
4
4
order: 12
5
5
---
6
6
7
-
Vue's transition system offers many simple ways to animate enteringand leaving, but what about when the data behind your view simply changes? This data is often used to display:
7
+
Vue's transition system offers many simple ways to animate entering, leaving, and lists, but what about animating your data itself? For example:
8
8
9
9
- numbers and calculations
10
+
- colors displayed
10
11
- the positions of SVG nodes
11
12
- the sizes and other properties of elements
12
-
- colors displayed
13
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
15
@@ -20,15 +20,15 @@ Watchers allow us to animate changes of any numerical property into another prop
Just 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.
See [this fiddle](https://jsfiddle.net/chrisvfritz/fbvusejy/) for the complete code behind the above demo.
378
+
242
379
## Organizing Transitions into Components
243
380
244
381
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:
0 commit comments