mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
🐛 修复 Qodana 报错
This commit is contained in:
@@ -11,7 +11,11 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="toc-material-grid">
|
||||
<TibCalendarMaterial v-for="item in itemVal.materials" :item="item" />
|
||||
<TibCalendarMaterial
|
||||
v-for="(item, index) in itemVal.materials"
|
||||
:key="index"
|
||||
:item="item"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<img src="/source/UI/item-line.webp" alt="line" class="toc-line" />
|
||||
@@ -48,7 +52,7 @@ import TibCalendarItem from "../itembox/tib-calendar-item.vue";
|
||||
import TibCalendarMaterial from "../itembox/tib-calendar-material.vue";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
//plugins
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
|
||||
interface ToCalendarProps {
|
||||
@@ -67,18 +71,20 @@ const props = defineProps<ToCalendarProps>();
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emits("update:modelValue", value),
|
||||
set: (value) => {
|
||||
emits("update:modelValue", value);
|
||||
},
|
||||
});
|
||||
const itemType = computed(() => props.dataType);
|
||||
const itemVal = computed<TGApp.App.Calendar.Item>(() => props.dataVal);
|
||||
const snackbar = ref<boolean>(false);
|
||||
|
||||
const onCancel = () => {
|
||||
const onCancel = (): void => {
|
||||
visible.value = false;
|
||||
emits("cancel");
|
||||
};
|
||||
|
||||
function toDetail(item: TGApp.App.Calendar.Item) {
|
||||
function toDetail(item: TGApp.App.Calendar.Item): void {
|
||||
if (item.contentId === 0) {
|
||||
snackbar.value = true;
|
||||
return;
|
||||
|
||||
@@ -4,7 +4,12 @@
|
||||
<div class="toc-top">
|
||||
<div class="toc-title">请选择要跳转的频道</div>
|
||||
<div class="toc-list">
|
||||
<div v-for="item in channelList" class="toc-list-item" @click="toChannel(item.link)">
|
||||
<div
|
||||
v-for="(item, index) in channelList"
|
||||
:key="index"
|
||||
class="toc-list-item"
|
||||
@click="toChannel(item.link)"
|
||||
>
|
||||
<img :src="item.icon" alt="icon" />
|
||||
<span>{{ item.title }}</span>
|
||||
</div>
|
||||
@@ -28,9 +33,7 @@ interface ToChannelProps {
|
||||
modelValue: boolean;
|
||||
}
|
||||
|
||||
interface ToChannelEmits {
|
||||
(e: "update:modelValue", value: boolean): void;
|
||||
}
|
||||
type ToChannelEmits = (e: "update:modelValue", value: boolean) => void;
|
||||
|
||||
interface ToChannelItem {
|
||||
title: string;
|
||||
@@ -45,7 +48,9 @@ const emits = defineEmits<ToChannelEmits>();
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emits("update:modelValue", value),
|
||||
set: (value) => {
|
||||
emits("update:modelValue", value);
|
||||
},
|
||||
});
|
||||
const router = useRouter();
|
||||
|
||||
@@ -87,13 +92,15 @@ const channelList: ToChannelItem[] = [
|
||||
},
|
||||
];
|
||||
|
||||
function onCancel() {
|
||||
function onCancel(): void {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
function toChannel(link: string) {
|
||||
async function toChannel(link: string): Promise<void> {
|
||||
visible.value = false;
|
||||
router.push(link);
|
||||
await router.push(link).then(() => {
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 300);
|
||||
|
||||
Reference in New Issue
Block a user