♻️ 代码结构调整

This commit is contained in:
目棃
2024-12-06 17:39:53 +08:00
parent dd65bb565d
commit 6a3d2d6b36
41 changed files with 559 additions and 947 deletions

View File

@@ -1,5 +1,5 @@
<template>
<TOverlay v-model="visible" hide :to-click="onCancel" blur-val="20px">
<TOverlay v-model="visible">
<div class="hta-oo-box">
<v-btn
:loading="loadShare"
@@ -63,34 +63,21 @@ import showSnackbar from "../func/snackbar.js";
import HtaOverviewLine from "./hta-overview-line.vue";
interface HtaOverlayOverviewProps {
type HtaOverlayOverviewProps = {
modelValue: boolean;
data: AbyssDataItem<TGApp.Plugins.Hutao.Abyss.OverviewData>;
}
interface HtaOverlayOverviewEmits {
(e: "update:modelValue", value: boolean): void;
(e: "cancel"): void;
}
};
type HtaOverlayOverviewEmits = (e: "update:modelValue", v: boolean) => void;
const props = defineProps<HtaOverlayOverviewProps>();
const emits = defineEmits<HtaOverlayOverviewEmits>();
const loadShare = ref<boolean>(false);
const visible = computed<boolean>({
get: () => props.modelValue,
set: (v) => emits("update:modelValue", v),
});
const dataCur = computed(() => props.data.cur);
const dataLast = computed(() => props.data.last);
const loadShare = ref<boolean>(false);
const visible = computed({
get: () => props.modelValue,
set: (value) => {
emits("update:modelValue", value);
},
});
function onCancel(): void {
visible.value = false;
emits("cancel");
}
async function share(): Promise<void> {
loadShare.value = true;