Slide 40
Slide 40 text
Animating a bar chart
Vue.component("animated-bar", {
props: ["value"],
template: `
{{ value }}
`,
data: () => ({ tweenedValue: 0 }),
computed: {
width() {
return this.tweenedValue * 30;
},
},
watch: {
value() {
gsap.to(this.$data, { duration: 0.6, tweenedValue: this.value });
},
},
}); @callumacrae