1new Vue({
2 el: '#animated-number-demo',
3 data: {
4 number: 0,
5 tweenedNumber: 0
6 },
7 computed: {
8 animatedNumber: function() {
9 return this.tweenedNumber.toFixed(0);
10 }
11 },
12 watch: {
13 number: function(newValue) {
14 gsap.to(this.$data, { duration: 0.1, tweenedNumber: newValue });
15 }
16 }
17})