fix
This commit is contained in:
parent
f625e4c40b
commit
302e452572
|
@ -9,7 +9,7 @@
|
|||
<i v-else-if="type === 'error'" :class="$style.iconInner" class="ph-circle-wavy-warning-bold ph-lg"></i>
|
||||
<i v-else-if="type === 'warning'" :class="$style.iconInner" class="ph-warning-bold ph-lg"></i>
|
||||
<i v-else-if="type === 'info'" :class="$style.iconInner" class="ph-info-bold ph-lg"></i>
|
||||
<i v-else-if="type === 'question'" :class="$style.iconInner" class="ph-circle-notch-bold ph-lg"></i>
|
||||
<i v-else-if="type === 'question'" :class="$style.iconInner" class="ph-circle-question-bold ph-lg"></i>
|
||||
<MkLoading v-else-if="type === 'waiting'" :class="$style.iconInner" :em="true"/>
|
||||
</div>
|
||||
<header v-if="title" :class="$style.title"><Mfm :text="title"/></header>
|
||||
|
|
|
@ -15,10 +15,12 @@ const props = withDefaults(defineProps<{
|
|||
inline?: boolean;
|
||||
colored?: boolean;
|
||||
mini?: boolean;
|
||||
em?: boolean;
|
||||
}>(), {
|
||||
inline: false,
|
||||
colored: true,
|
||||
mini: false,
|
||||
em: false,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -70,6 +72,12 @@ const props = withDefaults(defineProps<{
|
|||
padding: 16px;
|
||||
--size: 32px;
|
||||
}
|
||||
&.em {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
padding: 0;
|
||||
--size: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
|
|
|
@ -7,8 +7,8 @@ import * as Misskey from "calckey-js";
|
|||
import { apiUrl, url } from "@/config";
|
||||
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
||||
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
||||
import MkToast from '@/components/MkToast.vue';
|
||||
import MkDialog from '@/components/MkDialog.vue';
|
||||
import MkToast from "@/components/MkToast.vue";
|
||||
import MkDialog from "@/components/MkDialog.vue";
|
||||
import { MenuItem } from "@/types/menu";
|
||||
import { $i } from "@/account";
|
||||
|
||||
|
@ -248,41 +248,56 @@ export function modalPageWindow(path: string) {
|
|||
}
|
||||
|
||||
export function toast(message: string) {
|
||||
popup(MkToast, {
|
||||
popup(
|
||||
MkToast,
|
||||
{
|
||||
message,
|
||||
}, {}, 'closed');
|
||||
},
|
||||
{},
|
||||
"closed",
|
||||
);
|
||||
}
|
||||
|
||||
export function alert(props: {
|
||||
type?: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
|
||||
type?: "error" | "info" | "success" | "warning" | "waiting" | "question";
|
||||
title?: string | null;
|
||||
text?: string | null;
|
||||
}): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(MkDialog, props, {
|
||||
done: result => {
|
||||
popup(
|
||||
MkDialog,
|
||||
props,
|
||||
{
|
||||
done: (result) => {
|
||||
resolve();
|
||||
},
|
||||
}, 'closed');
|
||||
},
|
||||
"closed",
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function confirm(props: {
|
||||
type: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
|
||||
type: "error" | "info" | "success" | "warning" | "waiting" | "question";
|
||||
title?: string | null;
|
||||
text?: string | null;
|
||||
okText?: string;
|
||||
cancelText?: string;
|
||||
}): Promise<{ canceled: boolean }> {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(MkDialog, {
|
||||
popup(
|
||||
MkDialog,
|
||||
{
|
||||
...props,
|
||||
showCancelButton: true,
|
||||
}, {
|
||||
done: result => {
|
||||
},
|
||||
{
|
||||
done: (result) => {
|
||||
resolve(result ? result : { canceled: true });
|
||||
},
|
||||
}, 'closed');
|
||||
},
|
||||
"closed",
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue