Merge pull request #3516 from RitvikSardana/editor-upload-fn

fix: pass uploadFunction prop
This commit is contained in:
RitvikSardana
2026-06-30 03:16:48 +05:30
committed by GitHub
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -3,6 +3,7 @@
<FTextEditor
ref="e"
:extensions="[ComponentUtils, HandleExcelPaste, CleanStyles]"
:upload-function="uploadFunction"
v-bind="$attrs"
:editor-class="[
'prose-f max-h-64 max-w-none overflow-auto my-4 min-h-[5rem]',
@@ -72,6 +73,7 @@ import { computed, nextTick, ref } from "vue";
interface P {
modelValue: string;
autofocus?: boolean;
uploadFunction?: (file: any) => Promise<any>;
}
interface E {
@@ -86,7 +88,7 @@ const props = withDefaults(defineProps<P>(), {
defineEmits<E>();
const e = ref(null);
const editor = computed(() => e.value.editor);
const editor = computed(() => e.value?.editor);
const authStore = useAuthStore();
const fixedMenu = [
"Paragraph",
@@ -111,6 +113,6 @@ defineExpose({
});
if (props.autofocus) {
nextTick(() => e.value.editor.commands.focus());
nextTick(() => e.value?.editor?.commands?.focus());
}
</script>
@@ -4,6 +4,7 @@
ref="e"
:model-value="content"
:placeholder="placeholder"
:upload-function="uploadFunction"
@update:model-value="$emit('update:content', $event)"
@clear="() => $emit('update:attachments', [])"
>
@@ -97,6 +98,7 @@ interface P {
placeholder: string;
attachments: File[];
expand?: boolean;
uploadFunction?: (file: any) => Promise<any>;
}
interface E {