refactor: fix type errrors of some components
This commit is contained in:
parent
c4a093209f
commit
ef94ba1474
5 changed files with 11 additions and 13 deletions
|
@ -198,7 +198,7 @@ const props = withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
chosen: [v: string, ev?: MouseEvent],
|
||||
chosen: [v: string, ev?: MouseEvent];
|
||||
}>();
|
||||
|
||||
const search = ref<HTMLInputElement>();
|
||||
|
@ -415,9 +415,7 @@ function reset() {
|
|||
q.value = "";
|
||||
}
|
||||
|
||||
function getKey(
|
||||
emoji: EmojiDef,
|
||||
): string {
|
||||
function getKey(emoji: EmojiDef): string {
|
||||
if (typeof emoji === "string") {
|
||||
return emoji;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "done", v: any): void;
|
||||
(ev: "done", v: string): void;
|
||||
(ev: "close"): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
@ -64,7 +64,7 @@ function checkForShift(ev?: MouseEvent) {
|
|||
modal.value?.close(ev);
|
||||
}
|
||||
|
||||
function chosen(emoji: any, ev: MouseEvent) {
|
||||
function chosen(emoji: string, ev?: MouseEvent) {
|
||||
emit("done", emoji);
|
||||
checkForShift(ev);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<i :class="icon('ph-dots-three-outline')"></i>
|
||||
</button>
|
||||
<button
|
||||
v-if="!hideFollowButton && isSignedIn && me.id != user.id"
|
||||
v-if="!hideFollowButton && isSignedIn && me!.id != user.id"
|
||||
v-tooltip="full ? null : `${state} ${user.name || user.username}`"
|
||||
class="kpoogebi _button follow-button"
|
||||
:class="{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
ref="dialog"
|
||||
:width="370"
|
||||
:height="400"
|
||||
@close="dialog.close()"
|
||||
@close="dialog!.close()"
|
||||
@closed="emit('closed')"
|
||||
>
|
||||
<template #header>{{ i18n.ts.forgotPassword }}</template>
|
||||
|
@ -76,7 +76,7 @@ const emit = defineEmits<{
|
|||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const dialog: InstanceType<typeof XModalWindow> = ref();
|
||||
const dialog = ref<InstanceType<typeof XModalWindow> | null>(null);
|
||||
|
||||
const username = ref("");
|
||||
const email = ref("");
|
||||
|
@ -89,7 +89,7 @@ async function onSubmit() {
|
|||
email: email.value,
|
||||
});
|
||||
emit("done");
|
||||
dialog.value.close();
|
||||
dialog.value!.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
computed: {
|
||||
compiledFormula(): any {
|
||||
compiledFormula() {
|
||||
const katexString = katex.renderToString(this.formula, {
|
||||
throwOnError: false,
|
||||
} as any);
|
||||
});
|
||||
return this.block
|
||||
? `<div style="text-align:center">${katexString}</div>`
|
||||
: katexString;
|
||||
|
|
Loading…
Reference in a new issue