♻️ itemBox 组件重构,更加自由

This commit is contained in:
BTMuli
2023-06-02 17:43:10 +08:00
parent bb2fe8cf46
commit 50b1f16f7f
7 changed files with 161 additions and 144 deletions

View File

@@ -1,13 +1,28 @@
<template>
<TItemBox :data="props.modelValue as Record<string,string|number>" :size="props.size" model-value="wiki-avatar" display="inner" />
<TItemBox :model-value="box" />
</template>
<script lang="ts" setup>
import TItemBox from "../main/t-itembox.vue";
// vue
import { computed } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
interface TibCalendarAvatarProps {
size: string,
modelValue: TGApp.App.Character.WikiBriefInfo
modelValue: TGApp.App.Character.WikiBriefInfo;
}
const props = defineProps<TibCalendarAvatarProps>();
const box = computed(() => {
return {
bg: `/icon/bg/${props.modelValue.star}-Star.webp`,
icon: `/WIKI/character/icon/${props.modelValue.id}.webp`,
size: "128px",
height: "128px",
display: "inner",
lt: `/icon/element/${props.modelValue.element}元素.webp`,
ltSize: "40px",
innerHeight: 30,
innerIcon: `/icon/weapon/${props.modelValue.weapon}.webp`,
innerText: props.modelValue.name,
} as TItemBoxData;
});
</script>