Open thearabbit opened 6 years ago
I would also like to know how to use with dynamic data bindings
A work around that I've found working for me was to use the manual way, first calling reset and then start again after your data bindings updated. this.$refs.{refname}.reset(from, to) this.$refs.{refname}.start()
i have try it, but not work
eh, it must set data in reset like this this.$refs.{refname}.reset(this.from, this.to)
A work around that I've found working for me was to use the manual way, first calling reset and then start again after your data bindings updated. this.$refs.{refname}.reset(from, to) this.$refs.{refname}.start()
this one worked for me.
<animate-number ref="projectsNumber" from="0" :to="totalNumberOfProjects"></animate-number>
and after server request update the number like this:
.then(function(response) {
this.totalNumberOfProjects = this.sectionProjectContent.title;
this.$refs.projectsNumber.reset(0, this.totalNumberOfProjects);
this.$refs.projectsNumber.start();
});
Plus, you have to change the mode prop to manual
<animate-number ref="projectsNumber" from="0" :to="totalNumberOfProjects" mode="manual"></animate-number>
<animate-number
:key="unique value"
:from="from"
:to="to"
duration="1000"
:formatter="formatter"
></animate-number>
Each change key is a unique value. https://vuejs.org/v2/api/#key
Don't work when change
data props