♻️ 优化素材日历组件

This commit is contained in:
BTMuli
2023-06-26 17:00:44 +08:00
parent 05df2c0589
commit 0c923060b8
6 changed files with 139 additions and 175 deletions

View File

@@ -0,0 +1,45 @@
<template>
<TItemBox :model-value="box" />
</template>
<script lang="ts" setup>
// vue
import { computed } from "vue";
import TItemBox, { TItemBoxData } from "../main/t-itembox.vue";
interface TibCalendarItemProps {
model: "avatar" | "weapon";
data: TGApp.App.Calendar.Item;
clickable: boolean;
}
const props = defineProps<TibCalendarItemProps>();
const box = computed<TItemBoxData>(() => {
if (props.model === "avatar") {
return {
bg: props.data.bg,
icon: props.data.icon,
size: "100px",
height: "100px",
display: "inner",
clickable: props.clickable,
lt: props.data.elementIcon,
ltSize: "30px",
innerHeight: 25,
innerIcon: props.data.weaponIcon,
innerText: props.data.name,
};
}
return {
bg: props.data.bg,
icon: props.data.icon,
size: "100px",
height: "100px",
display: "inner",
clickable: props.clickable,
lt: props.data.weaponIcon,
ltSize: "30px",
innerHeight: 25,
innerText: props.data.name,
};
});
</script>