|
|
@@ -34,6 +34,7 @@ export function useFloatPanel<P extends Record<string, any> = Record<string, unk
|
|
|
let dismissResult: R | void | undefined;
|
|
|
|
|
|
const show = ref(false);
|
|
|
+ const title = ref('');
|
|
|
/** 为 true 表示正在等待 FloatPanel `closed`,用于忽略重开后的陈旧 `closed` */
|
|
|
const pendingCloseUnmount = ref(false);
|
|
|
const panelOpenKey = ref(0);
|
|
|
@@ -60,7 +61,7 @@ export function useFloatPanel<P extends Record<string, any> = Record<string, unk
|
|
|
}
|
|
|
|
|
|
const api: FloatPanelApi<P, R> = {
|
|
|
- open(props: P): Promise<R | void> {
|
|
|
+ open(props: P, text = ''): Promise<R | void> {
|
|
|
pending?.resolve(void 0);
|
|
|
pending = Promise.withResolvers<R | void>();
|
|
|
dismissResult = undefined;
|
|
|
@@ -68,6 +69,7 @@ export function useFloatPanel<P extends Record<string, any> = Record<string, unk
|
|
|
innerProps.value = props;
|
|
|
panelOpenKey.value += 1;
|
|
|
show.value = true;
|
|
|
+ title.value = text;
|
|
|
return pending.promise;
|
|
|
},
|
|
|
close(result?: R) {
|
|
|
@@ -137,7 +139,7 @@ export function useFloatPanel<P extends Record<string, any> = Record<string, unk
|
|
|
|
|
|
return h(
|
|
|
__FloatPanel_vue,
|
|
|
- { ref: floatPanelRef, key: panelOpenKey.value, closable: true, ...panelBindings },
|
|
|
+ { ref: floatPanelRef, key: panelOpenKey.value, closable: true, title: title.value, ...panelBindings },
|
|
|
{
|
|
|
header: slots.header,
|
|
|
content: () => {
|