Skip to content

Commit a3c2820

Browse files
committed
Fix Value animation bug only allowing one at a time
1 parent 8172d9d commit a3c2820

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/Value.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
{{ displayText }}
55
</button>
66
<transition-group name="diff-once" class="pos-absolute" tag="div" @after-enter="removeDiff()">
7-
<button v-for="(diff, index) in diffs" :key="index"
7+
<button v-for="diff in diffs" :key="diff.id"
88
class="btn btn-sm active fa diff-once" :class="`btn-${buttonStyle} fa-${faValue}`" style="cursor:default">
9-
{{diff}}
9+
{{diff.value}}
1010
</button>
1111
</transition-group>
1212
</div>
@@ -63,6 +63,7 @@ export default {
6363
6464
return {
6565
diffs: [],
66+
diffId: 0,
6667
buttonStyle: style.buttonStyle,
6768
faValue: style.fa,
6869
title: style.title
@@ -85,7 +86,8 @@ export default {
8586
value: function(newValue, oldValue) {
8687
console.log(typeof newValue);
8788
let diff = newValue - oldValue;
88-
this.diffs.push(diff);
89+
this.diffs.push({value: diff, id: this.diffId});
90+
this.diffId++;
8991
}
9092
}
9193
}

0 commit comments

Comments
 (0)