Fix for tab-elements fetching
This commit is contained in:
@@ -183,9 +183,16 @@ export default {
|
|||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.setWinnerdataToStorage();
|
this.setWinnerdataToStorage();
|
||||||
|
eventBus.$off("tab-change", () => {
|
||||||
|
this.fetchColorsAndWinners();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchColorsAndWinners();
|
this.fetchColorsAndWinners();
|
||||||
|
|
||||||
|
eventBus.$on("tab-change", () => {
|
||||||
|
this.fetchColorsAndWinners();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
stringify(json) {
|
stringify(json) {
|
||||||
|
|||||||
@@ -111,6 +111,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import io from "socket.io-client";
|
import io from "socket.io-client";
|
||||||
|
import eventBus from "@/mixins/EventBus";
|
||||||
import {
|
import {
|
||||||
addAttendee,
|
addAttendee,
|
||||||
getVirtualWinner,
|
getVirtualWinner,
|
||||||
|
|||||||
@@ -7,9 +7,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
@click="changeTab(index)"
|
@click="changeTab(index)"
|
||||||
:class="chosenTab == index ? 'active' : null"
|
:class="chosenTab == index ? 'active' : null"
|
||||||
>
|
>{{ tab.name }}</div>
|
||||||
{{ tab.name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-elements">
|
<div class="tab-elements">
|
||||||
<component
|
<component
|
||||||
@@ -23,6 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import eventBus from "@/mixins/EventBus";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
tabs: {
|
tabs: {
|
||||||
@@ -45,6 +44,7 @@ export default {
|
|||||||
changeTab: function(num) {
|
changeTab: function(num) {
|
||||||
this.chosenTab = num;
|
this.chosenTab = num;
|
||||||
this.$emit("tabChange", num);
|
this.$emit("tabChange", num);
|
||||||
|
eventBus.$emit("tab-change");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user