Animated Number
Animated numbers provide a signifier that values are being changed.
Examples
<script>
export default {
data() {
return {
updatedNumber: 100,
};
},
methods: {
updateNumber() {
this.updatedNumber = Math.floor(Math.random() * 100);
},
},
};
</script>
<template>
<div>
<gl-animated-number :number="updatedNumber" :duration="1000" />
<button @click="updateNumber">Update number</button>
</div>
</template>Code reference
GlAnimatedNumber
The animated number component can be used with or without decimal places. Decimal places will not be rounded if chosen to be omitted.
import { GlAnimatedNumber } from '@gitlab/ui'; Props
Name | Description | Default |
|---|---|---|
|
| — |
|
|
|
|
|
|
|
|
|
|
|
|
Events
Name | Description |
|---|---|
animating |
|
animated |
|
Last updated at: