🐛 修复 Qodana 报错

This commit is contained in:
BTMuli
2023-07-29 14:15:26 +08:00
parent d1fa7348c8
commit 062e34e585
31 changed files with 216 additions and 162 deletions

View File

@@ -4,16 +4,18 @@
<script lang="ts" setup>
// vue
import { onMounted, ref } from "vue";
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
import TItemBox from "../main/t-itembox.vue";
// utils
import TGSqlite from "../../plugins/Sqlite";
// types
import type { TItemBoxData } from "../main/t-itembox.vue";
interface TibAbyssDetailProps {
modelValue: TGApp.Sqlite.Abyss.CharacterInfo;
}
const props = defineProps<TibAbyssDetailProps>();
const box = ref({} as TItemBoxData);
const box = ref<TItemBoxData>(<TItemBoxData>{});
onMounted(async () => {
const res = await TGSqlite.getAppCharacter(props.modelValue.id);

View File

@@ -4,22 +4,25 @@
<script lang="ts" setup>
// vue
import { onMounted, ref } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
import TItemBox from "../main/t-itembox.vue";
// utils
import TGSqlite from "../../plugins/Sqlite";
// types
import type { TItemBoxData } from "../main/t-itembox.vue";
interface TibAbyssOverviewProps {
modelValue: TGApp.Sqlite.Abyss.Character;
}
const props = defineProps<TibAbyssOverviewProps>();
const box = ref({} as TItemBoxData);
const box = ref<TItemBoxData>(<TItemBoxData>{});
onMounted(async () => {
const res = await TGSqlite.getAppCharacter(props.modelValue.id);
box.value = {
height: "80px",
ltSize: "30px",
clickable: false,
bg: `/icon/bg/${props.modelValue.star}-Star.webp`,
icon: `/WIKI/character/icon/${props.modelValue.id}.webp`,
lt: `/icon/element/${res.element}元素.webp`,

View File

@@ -4,7 +4,9 @@
<script lang="ts" setup>
// vue
import { computed } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
import TItemBox from "../main/t-itembox.vue";
// types
import type { TItemBoxData } from "../main/t-itembox.vue";
interface TibCalendarItemProps {
model: "avatar" | "weapon";

View File

@@ -4,13 +4,15 @@
<script lang="ts" setup>
// vue
import { computed } from "vue";
import TItemBox2, { TItemBox2Data } from "../main/t-itembox-2.vue";
import TItemBox2 from "../main/t-itembox-2.vue";
// types
import type { TItemBox2Data } from "../main/t-itembox-2.vue";
interface TMiniWeaponProps {
item: TGApp.App.Calendar.Material;
}
const props = defineProps<TMiniWeaponProps>();
const box = computed(() => {
const box = computed<TItemBox2Data>(() => {
return {
bg: props.item.bg,
icon: props.item.icon,
@@ -18,6 +20,6 @@ const box = computed(() => {
width: "150px",
height: "45px",
name: props.item.name,
} as TItemBox2Data;
};
});
</script>

View File

@@ -4,15 +4,17 @@
<script lang="ts" setup>
// vue
import { onMounted, ref } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
import TItemBox from "../main/t-itembox.vue";
// types
import type { TItemBoxData } from "../main/t-itembox.vue";
interface TibUrAvatarProps {
modelValue: TGApp.Sqlite.Record.Avatar;
}
const props = defineProps<TibUrAvatarProps>();
const box = ref({} as TItemBoxData);
const getName = () => {
const box = ref<TItemBoxData>(<TItemBoxData>{});
const getName = (): string => {
return props.modelValue.id === 10000005
? "旅行者-空"
: props.modelValue.id === 10000007
@@ -36,7 +38,7 @@ onMounted(async () => {
};
});
function showData() {
function showData(): void {
// todo @click 应该出来的是一个弹窗,而不是 console
console.log(props.modelValue);
}

View File

@@ -4,17 +4,20 @@
<script lang="ts" setup>
// vue
import { computed } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
import TItemBox from "../main/t-itembox.vue";
// types
import type { TItemBoxData } from "../main/t-itembox.vue";
interface TibCalendarWeaponProps {
modelValue: TGApp.App.Weapon.WikiBriefInfo;
}
const props = defineProps<TibCalendarWeaponProps>();
const box = computed(() => {
const box = computed<TItemBoxData>(() => {
return {
bg: props.modelValue.bg,
icon: props.modelValue.icon,
clickable: true,
size: "128px",
height: "128px",
display: "inner",
@@ -22,6 +25,6 @@ const box = computed(() => {
ltSize: "40px",
innerText: props.modelValue.name,
innerHeight: 30,
} as TItemBoxData;
};
});
</script>