️ 更换游戏时若存在相同分区不重置分区索引

This commit is contained in:
BTMuli
2023-12-29 00:53:00 +08:00
parent b3133a1041
commit 5d9cce1079

View File

@@ -102,6 +102,7 @@
</div> </div>
</v-card> </v-card>
</div> </div>
<!-- todo 完善 loadmore -->
<div class="load-more"> <div class="load-more">
<v-btn :loading="loading" @click="freshPostData(true)"> <v-btn :loading="loading" @click="freshPostData(true)">
{{ rawData.page }}已加载{{ posts.length }}加载更多 {{ rawData.page }}已加载{{ posts.length }}加载更多
@@ -110,19 +111,17 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, nextTick, onMounted, ref, watch } from "vue"; import { nextTick, onMounted, ref, watch } from "vue";
import showConfirm from "../../components/func/confirm"; import showConfirm from "../../components/func/confirm";
import showSnackbar from "../../components/func/snackbar"; import showSnackbar from "../../components/func/snackbar";
import ToLoading from "../../components/overlay/to-loading.vue"; import ToLoading from "../../components/overlay/to-loading.vue";
import Mys from "../../plugins/Mys"; import Mys from "../../plugins/Mys";
import { useAppStore } from "../../store/modules/app";
import TGClient from "../../utils/TGClient"; import TGClient from "../../utils/TGClient";
import { createPost } from "../../utils/TGWindow"; import { createPost } from "../../utils/TGWindow";
const loading = ref<boolean>(true); const loading = ref<boolean>(true);
const loadingTitle = ref<string>("正在加载数据"); const loadingTitle = ref<string>("正在加载数据");
const appStore = useAppStore();
// 常量 // 常量
const sortList = { const sortList = {
@@ -233,8 +232,13 @@ onMounted(async () => {
watch(curGameLabel, async (newVal) => { watch(curGameLabel, async (newVal) => {
curGid.value = gameList[newVal]; curGid.value = gameList[newVal];
forumItem.value = Object.keys(forumList[newVal]); forumItem.value = Object.keys(forumList[newVal]);
curForumLabel.value = forumItem.value[0]; if (!forumItem.value.includes(curForumLabel.value)) {
freshCurForum(forumItem.value[0]); curForumLabel.value = forumItem.value[0];
freshCurForum(forumItem.value[0]);
} else {
freshCurForum(curForumLabel.value);
await freshPostData(false);
}
await freshNavData(); await freshNavData();
}); });