mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
🐛 修复 Qodana 报错
This commit is contained in:
@@ -22,7 +22,7 @@ const snackbar = ref(false);
|
||||
// data
|
||||
const cardsInfo = computed(() => AppCharacterData);
|
||||
|
||||
function toOuter(item: TGApp.App.Character.WikiBriefInfo) {
|
||||
function toOuter(item: TGApp.App.Character.WikiBriefInfo): void {
|
||||
if (item.contentId === 0) {
|
||||
snackbar.value = true;
|
||||
return;
|
||||
|
||||
@@ -128,27 +128,21 @@ const CardsInfoA = ref<TGApp.App.GCG.WikiBriefInfo[]>([]);
|
||||
const CardsInfoM = ref<TGApp.App.GCG.WikiBriefInfo[]>([]);
|
||||
const CardsInfoS = ref<TGApp.App.GCG.WikiBriefInfo[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await loadData();
|
||||
onMounted(() => {
|
||||
for (const item of allCards.value) {
|
||||
if (item.type === "角色牌") CardsInfoC.value.push(item);
|
||||
if (item.type === "行动牌") CardsInfoA.value.push(item);
|
||||
if (item.type === "魔物牌") CardsInfoM.value.push(item);
|
||||
}
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
async function loadData() {
|
||||
await Promise.allSettled(
|
||||
allCards.value.map(async (item) => {
|
||||
if (item.type === "角色牌") CardsInfoC.value.push(item);
|
||||
if (item.type === "行动牌") CardsInfoA.value.push(item);
|
||||
if (item.type === "魔物牌") CardsInfoM.value.push(item);
|
||||
}),
|
||||
);
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
function toOuter(cardName: string, cardId: number) {
|
||||
function toOuter(cardName: string, cardId: number): void {
|
||||
const url = Mys.Api.Obc.replace("{contentId}", cardId.toString());
|
||||
createTGWindow(url, "GCG", cardName, 1200, 800, true);
|
||||
}
|
||||
|
||||
async function searchCard() {
|
||||
async function searchCard(): Promise<void> {
|
||||
loading.value = true;
|
||||
if (search.value === "") {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -22,7 +22,7 @@ const snackbar = ref<boolean>(false);
|
||||
// data
|
||||
const cardsInfo = computed(() => AppWeaponData);
|
||||
|
||||
function toOuter(item: TGApp.App.Weapon.WikiBriefInfo) {
|
||||
function toOuter(item: TGApp.App.Weapon.WikiBriefInfo): void {
|
||||
if (item.contentId === 0) {
|
||||
snackbar.value = true;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user