♻️ 重构成就表格,支持多存档

#126
This commit is contained in:
目棃
2024-09-20 15:57:02 +08:00
parent a8a667871a
commit 1dc5aa0ef8
28 changed files with 1198 additions and 1239 deletions

View File

@@ -37,6 +37,8 @@ let confirmInstance: VNode;
/**
* @function showConfirm
* @since Beta v0.3.9
* @todo 重载重构
* @description 弹出 confirm
* @param {TGApp.Component.Confirm.Params} props confirm 的参数
* @return {Promise<string | boolean | undefined>} 点击确认返回 true点击取消返回 false点击外部返回 undefined

View File

@@ -36,10 +36,17 @@ import { nextTick, onMounted, reactive, ref, watch, useTemplateRef } from "vue";
interface ConfirmProps {
title: string;
text?: string;
mode?: "confirm" | "input";
mode: "confirm" | "input";
otcancel?: boolean;
}
const defaultProp: ConfirmProps = {
title: "",
text: "",
mode: "confirm",
otcancel: false,
};
const props = withDefaults(defineProps<ConfirmProps>(), {
title: "",
text: "",
@@ -48,9 +55,7 @@ const props = withDefaults(defineProps<ConfirmProps>(), {
});
// 组件参数
const data = reactive<TGApp.Component.Confirm.Params>({
title: "",
});
const data = reactive<TGApp.Component.Confirm.Params>(defaultProp);
const show = ref<boolean>(false);
const showOuter = ref<boolean>(false);
const showInner = ref<boolean>(false);

View File

@@ -35,6 +35,7 @@ const renderBox = (props: TGApp.Component.Snackbar.Params): VNode => {
let snackbarInstance: VNode;
// todo 参数重构
function showSnackbar(props: TGApp.Component.Snackbar.Params): void {
if (snackbarInstance !== undefined) {
const boxVue = <SnackbarInstance>snackbarInstance.component;