aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/ModsView.vue
blob: a821dcda522aa0a6107d36903088f97cca33c09e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
    <div class="fc-container" style="display: flex">
        <!-- Local mods/Thunderstore mods menu -->
        <mods-menu
            :showingLocalMods="show_local_mods"
            @showLocalMods="(v) => show_local_mods = v"
        />

        <!-- Mods content -->
        <div class="fc_mods__container">
            <local-mods-view
                v-if="show_local_mods"
            />

            <thunderstore-mods-view
                v-else
                clearable
            />
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import ThunderstoreModsView from "./mods/ThunderstoreModsView.vue";
import LocalModsView from "./mods/LocalModsView.vue";
import ModsMenu from "../components/ModsMenu.vue";

export default defineComponent({
    name: "ModsView",
    components: {
        ModsMenu,
        LocalModsView,
        ThunderstoreModsView
    },
    data() {
        return {
            show_local_mods: true,
        }
    },
    mounted() {
        // Fetch Thunderstore mods to eventually display outdated mods count
        this.$store.commit('fetchThunderstoreMods');
    }
});
</script>

<style scoped>
.fc_mods__container {
    display: flex;
    width: 100%;
    flex-direction: column;
}
</style>