mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
✏️ 完善类型
This commit is contained in:
@@ -13,14 +13,14 @@ const confirmId = "tg-func-confirm";
|
||||
|
||||
/**
|
||||
* @description 自定义 confirm 组件
|
||||
* @since Beta v0.3.3
|
||||
* @since Beta v0.3.4
|
||||
* @extends ComponentInternalInstance
|
||||
* @property {Function} exposeProxy.displayBox 显示 confirm
|
||||
* @return ConfirmInstance
|
||||
*/
|
||||
interface ConfirmInstance extends ComponentInternalInstance {
|
||||
exposeProxy: {
|
||||
displayBox: typeof TGApp.Component.Confirm.displayBox;
|
||||
displayBox: (props: TGApp.Component.Confirm.Params) => Promise<string | boolean>;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ async function showConfirm(props: TGApp.Component.Confirm.Params): Promise<strin
|
||||
async function showConfirm(props: TGApp.Component.Confirm.Params): Promise<string | boolean> {
|
||||
if (confirmInstance !== undefined) {
|
||||
const boxVue = <ConfirmInstance>confirmInstance.component;
|
||||
return boxVue.exposeProxy.displayBox(props);
|
||||
return await boxVue.exposeProxy.displayBox(props);
|
||||
} else {
|
||||
confirmInstance = renderBox(props);
|
||||
return await showConfirm(props);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file component func snackbar.ts
|
||||
* @description 封装 vuetify 的 snackbar 组件,通过函数调用的方式,简化 snackbar 的使用
|
||||
* @since Beta v0.3.3
|
||||
* @since Beta v0.3.4
|
||||
*/
|
||||
|
||||
import type { ComponentInternalInstance, VNode } from "vue";
|
||||
@@ -20,7 +20,7 @@ const snackbarId = "tg-func-snackbar";
|
||||
*/
|
||||
interface SnackbarInstance extends ComponentInternalInstance {
|
||||
exposeProxy: {
|
||||
displayBox: typeof TGApp.Component.Snackbar.displayBox;
|
||||
displayBox: (props: TGApp.Component.Snackbar.Params) => void;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user