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<{
|
const emit = defineEmits<{
|
||||||
chosen: [v: string, ev?: MouseEvent],
|
chosen: [v: string, ev?: MouseEvent];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const search = ref<HTMLInputElement>();
|
const search = ref<HTMLInputElement>();
|
||||||
|
@ -415,9 +415,7 @@ function reset() {
|
||||||
q.value = "";
|
q.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getKey(
|
function getKey(emoji: EmojiDef): string {
|
||||||
emoji: EmojiDef,
|
|
||||||
): string {
|
|
||||||
if (typeof emoji === "string") {
|
if (typeof emoji === "string") {
|
||||||
return emoji;
|
return emoji;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ withDefaults(
|
||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: "done", v: any): void;
|
(ev: "done", v: string): void;
|
||||||
(ev: "close"): void;
|
(ev: "close"): void;
|
||||||
(ev: "closed"): void;
|
(ev: "closed"): void;
|
||||||
}>();
|
}>();
|
||||||
|
@ -64,7 +64,7 @@ function checkForShift(ev?: MouseEvent) {
|
||||||
modal.value?.close(ev);
|
modal.value?.close(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
function chosen(emoji: any, ev: MouseEvent) {
|
function chosen(emoji: string, ev?: MouseEvent) {
|
||||||
emit("done", emoji);
|
emit("done", emoji);
|
||||||
checkForShift(ev);
|
checkForShift(ev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<i :class="icon('ph-dots-three-outline')"></i>
|
<i :class="icon('ph-dots-three-outline')"></i>
|
||||||
</button>
|
</button>
|
||||||
<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}`"
|
v-tooltip="full ? null : `${state} ${user.name || user.username}`"
|
||||||
class="kpoogebi _button follow-button"
|
class="kpoogebi _button follow-button"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
ref="dialog"
|
ref="dialog"
|
||||||
:width="370"
|
:width="370"
|
||||||
:height="400"
|
:height="400"
|
||||||
@close="dialog.close()"
|
@close="dialog!.close()"
|
||||||
@closed="emit('closed')"
|
@closed="emit('closed')"
|
||||||
>
|
>
|
||||||
<template #header>{{ i18n.ts.forgotPassword }}</template>
|
<template #header>{{ i18n.ts.forgotPassword }}</template>
|
||||||
|
@ -76,7 +76,7 @@ const emit = defineEmits<{
|
||||||
(ev: "closed"): void;
|
(ev: "closed"): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const dialog: InstanceType<typeof XModalWindow> = ref();
|
const dialog = ref<InstanceType<typeof XModalWindow> | null>(null);
|
||||||
|
|
||||||
const username = ref("");
|
const username = ref("");
|
||||||
const email = ref("");
|
const email = ref("");
|
||||||
|
@ -89,7 +89,7 @@ async function onSubmit() {
|
||||||
email: email.value,
|
email: email.value,
|
||||||
});
|
});
|
||||||
emit("done");
|
emit("done");
|
||||||
dialog.value.close();
|
dialog.value!.close();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
compiledFormula(): any {
|
compiledFormula() {
|
||||||
const katexString = katex.renderToString(this.formula, {
|
const katexString = katex.renderToString(this.formula, {
|
||||||
throwOnError: false,
|
throwOnError: false,
|
||||||
} as any);
|
});
|
||||||
return this.block
|
return this.block
|
||||||
? `<div style="text-align:center">${katexString}</div>`
|
? `<div style="text-align:center">${katexString}</div>`
|
||||||
: katexString;
|
: katexString;
|
||||||
|
|
Loading…
Reference in a new issue