Former-commit-id: db322a1e24a6a230abfe0d8a9048aa2bdceb40c5
Former-commit-id: d2e563462ebf285038eecf629c1a6b8c3f538360
Former-commit-id: 32b369d2c6a09f4a34824cb9c36f664097a4e20c
Former-commit-id: 733f7be989504cac791159c61bd03214dfe14302 [formerly aab29fb39b1ea444774e85a2702016efde0f1360]
Former-commit-id: c2fc9123a08ef72a299473c3ed459b7614de648d
Former-commit-id: 620019ead1e8befb6eca3b1ac4fad7f38eecbf63
Former-commit-id: 1fd979ca052431d0a47a2544eefafd9a0592c1cf
Former-commit-id: aeb7be4633754092d1a722a1cd0ea970d4667f5c
Former-commit-id: 74a425066c216ec93f57d07f71f10d0a39398f1f
This commit is contained in:
FairyEver
2019-12-08 18:57:27 +08:00
parent 2f76abe76d
commit 27c030ea11

View File

@@ -3,6 +3,7 @@
</template>
<script>
// https://github.com/inorganik/CountUp.js
import { CountUp } from 'countup.js'
export default {
name: 'd2-count-up',
@@ -57,14 +58,12 @@ export default {
methods: {
init () {
if (!this.c) {
this.c = new CountUp(
this.$el,
this.start,
this.end,
this.decimals,
this.duration,
this.options
)
this.c = new CountUp(this.$el, this.end, {
startVal: this.start,
decimalPlaces: this.decimals,
duration: this.duration,
...this.options
})
this.c.start(() => {
this.callback(this.c)
})