feat: show a MkLoading when posting

This commit is contained in:
Lhcfl 2024-04-05 11:40:58 +08:00
parent 0a080159d4
commit 12aa04447b
2 changed files with 16 additions and 3 deletions

View file

@ -85,8 +85,17 @@
data-cy-open-post-form-submit data-cy-open-post-form-submit
@click="post" @click="post"
> >
{{ submitText {{ submitText }}
}}<i <!-- 1.3333 is the em of .ph-lg -->
<MkLoading
v-if="posting"
class="spinner"
:em="true"
:colored="false"
:size-em="1.3333"
/>
<i
v-else
:class=" :class="
icon( icon(
reply reply
@ -1399,6 +1408,7 @@ onMounted(() => {
opacity: 0.7; opacity: 0.7;
} }
> .spinner,
> i { > i {
margin-left: 6px; margin-left: 6px;
} }

View file

@ -6,6 +6,7 @@
[$style.inline]: inline, [$style.inline]: inline,
[$style.colored]: colored, [$style.colored]: colored,
[$style.mini]: mini, [$style.mini]: mini,
[$style.em]: em,
}, },
]" ]"
> >
@ -36,12 +37,14 @@ const props = withDefaults(
colored?: boolean; colored?: boolean;
mini?: boolean; mini?: boolean;
em?: boolean; em?: boolean;
sizeEm?: number;
}>(), }>(),
{ {
inline: false, inline: false,
colored: true, colored: true,
mini: false, mini: false,
em: false, em: false,
sizeEm: 1,
}, },
); );
</script> </script>
@ -98,7 +101,7 @@ const props = withDefaults(
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
padding: 0; padding: 0;
--size: 1em; --size: v-bind(sizeEm);
} }
} }