🐛 修复 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,7 +4,7 @@
<span>命之座</span>
</template>
<template #content>
<TucDetailConstellation v-model="props.modelValue" />
<TucDetailConstellation :model-value="props.modelValue" />
<div class="tuc-ddc-content">
<div class="tuc-ddc-top">
{{ props.modelValue.name }}
@@ -18,7 +18,8 @@
</div>
</template>
<template #desc>
<span v-html="parseDesc(props.modelValue.description)" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="parseDesc(props.modelValue.description)"></span>
</template>
</TucDetailDesc>
</template>

View File

@@ -4,7 +4,7 @@
<span>圣遗物</span>
</template>
<template #content>
<TucDetailRelic v-model="props.modelValue" pos="props.modelValue.pos" />
<TucDetailRelic :model-value="props.modelValue" pos="props.modelValue.pos" />
<div class="tuc-ddr-content">
<div class="tuc-ddrc-top">
<span>{{ props.modelValue.name }}</span>
@@ -18,7 +18,7 @@
</template>
<template #desc>
<div class="tuc-ddrd-title">{{ props.modelValue.set.name }}</div>
<div v-for="desc in props.modelValue.set.effect" class="tuc-ddrc-desc">
<div v-for="(desc, index) in props.modelValue.set.effect" :key="index" class="tuc-ddrc-desc">
<span>{{ desc.active }}件套</span>
<span>{{ desc.description }}</span>
</div>

View File

@@ -108,7 +108,9 @@ const emits = defineEmits<ToUcDetailEmits>();
const props = defineProps<ToUcDetailProps>();
const visible = computed({
get: () => props.modelValue,
set: (value) => emits("update:modelValue", value),
set: (value) => {
emits("update:modelValue", value);
},
});
const showCostumeSwitch = ref(false);
@@ -139,12 +141,12 @@ const selected = ref({
});
// 加载数据
function loadData() {
function loadData(): void {
if (!props.modelValue) return;
data.value.weapon = JSON.parse(props.dataVal.weapon);
data.value.constellation = JSON.parse(props.dataVal.constellation);
if (props.dataVal.reliquary !== "") {
const relics = <Array<TGApp.Sqlite.Character.RoleReliquary>>JSON.parse(props.dataVal.reliquary);
const relics = <TGApp.Sqlite.Character.RoleReliquary[]>JSON.parse(props.dataVal.reliquary);
relics.map((item) => {
switch (item.pos) {
case 1:
@@ -195,7 +197,7 @@ const weaponBox = computed(() => {
};
});
const onCancel = () => {
const onCancel = (): void => {
visible.value = false;
emits("cancel");
};
@@ -208,7 +210,7 @@ function showDetail(
| false,
type: "命座" | "武器" | "圣遗物",
pos: number = 0,
) {
): void {
if (!item) return;
switch (type) {
case "命座":
@@ -229,7 +231,7 @@ function showDetail(
};
}
function switchBg() {
function switchBg(): void {
if (data.value.bg === props.dataVal.img) {
data.value.bg = data.value.costume[0].icon;
} else {