mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-19 10:23:21 +08:00
♻️ itemBox 组件重构,更加自由
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user