fix: Remove animated running numbers (#3604)
This commit is contained in:
parent
83655f4ca4
commit
0130e08016
3 changed files with 1 additions and 36 deletions
|
@ -14,8 +14,6 @@
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import TWEEN from 'tween.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WootTabsItem',
|
name: 'WootTabsItem',
|
||||||
props: {
|
props: {
|
||||||
|
@ -41,43 +39,16 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
animatedNumber: 0,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
active() {
|
active() {
|
||||||
return this.index === this.$parent.index;
|
return this.index === this.$parent.index;
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemCount() {
|
getItemCount() {
|
||||||
return this.animatedNumber || this.count;
|
return this.count;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
|
||||||
count(newValue, oldValue) {
|
|
||||||
let animationFrame;
|
|
||||||
const animate = time => {
|
|
||||||
TWEEN.update(time);
|
|
||||||
animationFrame = window.requestAnimationFrame(animate);
|
|
||||||
};
|
|
||||||
const tweeningNumber = { value: oldValue };
|
|
||||||
new TWEEN.Tween(tweeningNumber)
|
|
||||||
.easing(TWEEN.Easing.Quadratic.Out)
|
|
||||||
.to({ value: newValue }, 500)
|
|
||||||
.onUpdate(() => {
|
|
||||||
this.animatedNumber = tweeningNumber.value.toFixed(0);
|
|
||||||
})
|
|
||||||
.onComplete(() => {
|
|
||||||
window.cancelAnimationFrame(animationFrame);
|
|
||||||
})
|
|
||||||
.start();
|
|
||||||
animationFrame = window.requestAnimationFrame(animate);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
onTabClick(event) {
|
onTabClick(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
@ -51,7 +51,6 @@
|
||||||
"semver": "7.3.5",
|
"semver": "7.3.5",
|
||||||
"spinkit": "~1.2.5",
|
"spinkit": "~1.2.5",
|
||||||
"tailwindcss": "^1.9.6",
|
"tailwindcss": "^1.9.6",
|
||||||
"tween.js": "~16.6.0",
|
|
||||||
"url-loader": "^2.0.0",
|
"url-loader": "^2.0.0",
|
||||||
"v-tooltip": "~2.1.3",
|
"v-tooltip": "~2.1.3",
|
||||||
"vue": "2.6.12",
|
"vue": "2.6.12",
|
||||||
|
|
|
@ -14533,11 +14533,6 @@ tunnel-agent@^0.6.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "^5.0.1"
|
safe-buffer "^5.0.1"
|
||||||
|
|
||||||
tween.js@~16.6.0:
|
|
||||||
version "16.6.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tween.js/-/tween.js-16.6.0.tgz#739104c9336cc4f11ee53f9ce7cede51e6723624"
|
|
||||||
integrity sha1-c5EEyTNsxPEe5T+c587eUeZyNiQ=
|
|
||||||
|
|
||||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||||
version "0.14.5"
|
version "0.14.5"
|
||||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||||
|
|
Loading…
Reference in a new issue