mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
⚡️ 优化底部 hint
This commit is contained in:
@@ -157,9 +157,7 @@ watch(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => await loadData());
|
||||||
await loadData();
|
|
||||||
});
|
|
||||||
|
|
||||||
async function toWiki(): Promise<void> {
|
async function toWiki(): Promise<void> {
|
||||||
if (props.item.contentId === 0) {
|
if (props.item.contentId === 0) {
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ async function loadData(): Promise<void> {
|
|||||||
const res = await getWikiData("Weapon", props.item.id.toString());
|
const res = await getWikiData("Weapon", props.item.id.toString());
|
||||||
if (res === undefined) return;
|
if (res === undefined) return;
|
||||||
data.value = res.default;
|
data.value = res.default;
|
||||||
|
showSnackbar({
|
||||||
|
text: `成功获取武器 ${props.item.name} 的 Wiki 数据`,
|
||||||
|
color: "success",
|
||||||
|
});
|
||||||
selectItems.value = data.value?.affix.Descriptions.map((item) => item.Level) ?? [];
|
selectItems.value = data.value?.affix.Descriptions.map((item) => item.Level) ?? [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ onBeforeMount(() => {
|
|||||||
const item = cardsInfo.find((item) => item.id.toString() === id);
|
const item = cardsInfo.find((item) => item.id.toString() === id);
|
||||||
if (item) {
|
if (item) {
|
||||||
curItem.value = item;
|
curItem.value = item;
|
||||||
showSnackbar({
|
|
||||||
text: `成功获取角色 ${item.name} 的数据`,
|
|
||||||
color: "success",
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: `角色 ${id} 不存在`,
|
text: `角色 ${id} 不存在`,
|
||||||
@@ -58,10 +54,6 @@ async function switchC(item: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
curItem.value = item;
|
curItem.value = item;
|
||||||
showSnackbar({
|
|
||||||
text: `成功获取角色 ${item.name} 的数据`,
|
|
||||||
color: "success",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toOuter(item?: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
async function toOuter(item?: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ onBeforeMount(() => {
|
|||||||
const item = cardsInfo.find((item) => item.id.toString() === id);
|
const item = cardsInfo.find((item) => item.id.toString() === id);
|
||||||
if (item) {
|
if (item) {
|
||||||
curItem.value = item;
|
curItem.value = item;
|
||||||
showSnackbar({
|
|
||||||
text: `成功获取武器 ${item.name} 的数据`,
|
|
||||||
color: "success",
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: `武器 ${id} 不存在`,
|
text: `武器 ${id} 不存在`,
|
||||||
@@ -55,10 +51,6 @@ onBeforeMount(() => {
|
|||||||
|
|
||||||
async function switchW(item: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
async function switchW(item: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
||||||
curItem.value = item;
|
curItem.value = item;
|
||||||
showSnackbar({
|
|
||||||
text: `成功获取武器 ${item.name} 的数据`,
|
|
||||||
color: "success",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toOuter(item?: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
async function toOuter(item?: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user