mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🌱 图鉴页面开始动工?
This commit is contained in:
@@ -1 +1,25 @@
|
||||
<template />
|
||||
<template></template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import { getWikiData } from "../../data";
|
||||
|
||||
const id = <string>useRoute().params.id;
|
||||
const data = ref<any>();
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const res = await getWikiData("Weapon", id);
|
||||
data.value = res.default;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
showSnackbar({
|
||||
text: "Wiki 数据获取失败",
|
||||
color: "error",
|
||||
});
|
||||
history.back();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user