From fd7564e1492750f0ce91ee74ced89eb12eb61747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Wed, 17 Jan 2024 21:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BA=95=E9=83=A8=20hint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/wiki/twc-character.vue | 4 +--- src/components/wiki/twc-weapon.vue | 4 ++++ src/pages/WIKI/Character.vue | 8 -------- src/pages/WIKI/Weapon.vue | 8 -------- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/components/wiki/twc-character.vue b/src/components/wiki/twc-character.vue index 65e8d316..97608472 100644 --- a/src/components/wiki/twc-character.vue +++ b/src/components/wiki/twc-character.vue @@ -157,9 +157,7 @@ watch( }, ); -onMounted(async () => { - await loadData(); -}); +onMounted(async () => await loadData()); async function toWiki(): Promise { if (props.item.contentId === 0) { diff --git a/src/components/wiki/twc-weapon.vue b/src/components/wiki/twc-weapon.vue index 7a76c219..3d3874b2 100644 --- a/src/components/wiki/twc-weapon.vue +++ b/src/components/wiki/twc-weapon.vue @@ -93,6 +93,10 @@ async function loadData(): Promise { const res = await getWikiData("Weapon", props.item.id.toString()); if (res === undefined) return; data.value = res.default; + showSnackbar({ + text: `成功获取武器 ${props.item.name} 的 Wiki 数据`, + color: "success", + }); selectItems.value = data.value?.affix.Descriptions.map((item) => item.Level) ?? []; } catch (error) { showSnackbar({ diff --git a/src/pages/WIKI/Character.vue b/src/pages/WIKI/Character.vue index 51db24af..583eb43d 100644 --- a/src/pages/WIKI/Character.vue +++ b/src/pages/WIKI/Character.vue @@ -38,10 +38,6 @@ onBeforeMount(() => { const item = cardsInfo.find((item) => item.id.toString() === id); if (item) { curItem.value = item; - showSnackbar({ - text: `成功获取角色 ${item.name} 的数据`, - color: "success", - }); } else { showSnackbar({ text: `角色 ${id} 不存在`, @@ -58,10 +54,6 @@ async function switchC(item: TGApp.App.Character.WikiBriefInfo): Promise { return; } curItem.value = item; - showSnackbar({ - text: `成功获取角色 ${item.name} 的数据`, - color: "success", - }); } async function toOuter(item?: TGApp.App.Character.WikiBriefInfo): Promise { diff --git a/src/pages/WIKI/Weapon.vue b/src/pages/WIKI/Weapon.vue index e49219bc..b46e2d41 100644 --- a/src/pages/WIKI/Weapon.vue +++ b/src/pages/WIKI/Weapon.vue @@ -39,10 +39,6 @@ onBeforeMount(() => { const item = cardsInfo.find((item) => item.id.toString() === id); if (item) { curItem.value = item; - showSnackbar({ - text: `成功获取武器 ${item.name} 的数据`, - color: "success", - }); } else { showSnackbar({ text: `武器 ${id} 不存在`, @@ -55,10 +51,6 @@ onBeforeMount(() => { async function switchW(item: TGApp.App.Weapon.WikiBriefInfo): Promise { curItem.value = item; - showSnackbar({ - text: `成功获取武器 ${item.name} 的数据`, - color: "success", - }); } async function toOuter(item?: TGApp.App.Weapon.WikiBriefInfo): Promise {