mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-25 05:29:45 +08:00
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user