mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
♻️ 首页日历组件添加wiki跳转,移除wiki子窗口
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onBeforeMount, ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
@@ -26,11 +27,29 @@ import { AppCharacterData } from "../../data";
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
const id = useRoute().params.id.toString() ?? "0";
|
||||
const cardsInfo = AppCharacterData;
|
||||
const curItem = ref<TGApp.App.Character.WikiBriefInfo>();
|
||||
|
||||
onBeforeMount(() => {
|
||||
curItem.value = cardsInfo[0];
|
||||
if (id === "0") {
|
||||
curItem.value = cardsInfo[0];
|
||||
} else {
|
||||
const item = cardsInfo.find((item) => item.id.toString() === id);
|
||||
if (item) {
|
||||
curItem.value = item;
|
||||
showSnackbar({
|
||||
text: `成功获取角色 ${item.name} 的数据`,
|
||||
color: "success",
|
||||
});
|
||||
} else {
|
||||
showSnackbar({
|
||||
text: `角色 ${id} 不存在`,
|
||||
color: "warn",
|
||||
});
|
||||
curItem.value = cardsInfo[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
async function switchC(item: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
||||
@@ -39,6 +58,10 @@ async function switchC(item: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
||||
return;
|
||||
}
|
||||
curItem.value = item;
|
||||
showSnackbar({
|
||||
text: `成功获取角色 ${item.name} 的数据`,
|
||||
color: "success",
|
||||
});
|
||||
}
|
||||
|
||||
async function toOuter(item?: TGApp.App.Character.WikiBriefInfo): Promise<void> {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onBeforeMount, ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
@@ -27,15 +28,37 @@ import { AppWeaponData } from "../../data";
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
const id = useRoute().params.id.toString() ?? "0";
|
||||
const cardsInfo = AppWeaponData;
|
||||
const curItem = ref<TGApp.App.Weapon.WikiBriefInfo>();
|
||||
|
||||
onBeforeMount(() => {
|
||||
curItem.value = cardsInfo[0];
|
||||
if (id === "0") {
|
||||
curItem.value = cardsInfo[0];
|
||||
} else {
|
||||
const item = cardsInfo.find((item) => item.id.toString() === id);
|
||||
if (item) {
|
||||
curItem.value = item;
|
||||
showSnackbar({
|
||||
text: `成功获取武器 ${item.name} 的数据`,
|
||||
color: "success",
|
||||
});
|
||||
} else {
|
||||
showSnackbar({
|
||||
text: `武器 ${id} 不存在`,
|
||||
color: "warn",
|
||||
});
|
||||
curItem.value = cardsInfo[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
async function switchW(item: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
||||
curItem.value = item;
|
||||
showSnackbar({
|
||||
text: `成功获取武器 ${item.name} 的数据`,
|
||||
color: "success",
|
||||
});
|
||||
}
|
||||
|
||||
async function toOuter(item?: TGApp.App.Weapon.WikiBriefInfo): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user