fix(sth): v-if

This commit is contained in:
BTMuli
2023-04-03 00:00:41 +08:00
parent 871bf03190
commit aed91bcc04
4 changed files with 21 additions and 11 deletions

View File

@@ -20,7 +20,7 @@
<img src="/source/UI/paimon.webp" alt="homeIcon" class="sideIcon" />
</template>
</v-list-item>
<v-list-item title="公告" value="announcements" link href="/announcements">
<v-list-item title="公告" value="news" link href="/news">
<template v-slot:prepend>
<img src="../assets/icons/board.svg" alt="annoIcon" class="sideIcon" />
</template>
@@ -56,7 +56,9 @@
</template>
<script lang="ts" setup>
// vue
import { ref } from "vue";
// store
import useAppStore from "../store/modules/app";
const appStore = useAppStore();

View File

@@ -1,7 +1,7 @@
<template>
<t-pool v-show="homeStore.pool.show" />
<t-position v-show="homeStore.position.show" />
<t-calendar v-show="homeStore.calendar.show" />
<t-pool v-if="homeStore.pool.show" />
<t-position v-if="homeStore.position.show" />
<t-calendar v-if="homeStore.calendar.show" />
</template>
<script lang="ts" setup>

View File

@@ -2,7 +2,7 @@
* @file store modules app.ts
* @description App store module
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha
* @since Alpha v0.1.1
*/
import { defineStore } from "pinia";

View File

@@ -27,12 +27,20 @@ const useHomeStore = defineStore({
},
actions: {
async init() {
this.calendar.show = true;
this.calendar.order = 3;
this.pool.show = true;
this.pool.order = 1;
this.position.show = true;
this.position.order = 2;
this.$state = {
calendar: {
show: true,
order: 3,
},
pool: {
show: true,
order: 1,
},
position: {
show: true,
order: 2,
},
};
},
getShowItem() {
return ["素材日历", "限时祈愿", "近期活动"];