hanhdt / vue-trix

Trix text editor component for Vue.js
https://nicedoc.io/hanhdt/vue-trix
MIT License
242 stars 37 forks source link

Why is that attachments /pictures are not displaying in my trix-editor #157

Open abrhambas01 opened 4 years ago

abrhambas01 commented 4 years ago

This is in my template / vue file :

     <div class="flex inline-block w-full">
             <VueTrix class="editor1 w-full" inputId="editor1" @trix-change="handleEditorChange" @trix-attachment-remove="handleAttachmentRemove" @trix-attachment-add="handleAttachmentAdd" v-model="form.complete_description" />
            </div>

it displays the contents inside here

image

but in the editor it doesn't show up

image

hanhdt commented 4 years ago

Can you log the data inside form.complete_description before and after the attachment event is fired?

abrhambas01 commented 4 years ago

which event here sir?

hanhdt commented 4 years ago

On both @trix-attachment-remove="handleAttachmentRemove" @trix-attachment-add="handleAttachmentAdd", could you see v-model changes?

abrhambas01 commented 4 years ago

like this ?

handleAttachmentRemove(file){

    console.log(file);
handleAttachmentAdd(event){
            console.log(event);

or maybe this one ?

@trix-initialize="handleTrixInit"

abrhambas01 commented 4 years ago

how can I check it @hanhdt Ofcourse I can't trigger the handleAttachmentRemove function but the "@trix-attachment-add="handleAttachmentAdd". I can definitely do that

this is when I erase the file_name / the name of the file in the trix-editor. And replace / add it with new one then I remove the file

image

hanhdt commented 4 years ago

So, print out form.complete_description and I would like to see what you saved?

abrhambas01 commented 4 years ago

where will I write it in mounted()? form.complete_description?

hanhdt commented 4 years ago

When @trix-attachment-add is trigged, let print out your form.complete_description content?

abrhambas01 commented 4 years ago

it would look like this image

@hanhdt

hanhdt commented 4 years ago

@abrhambas01 Sorry for late response. Please, trace to image's src and make sure it exists.

abrhambas01 commented 4 years ago

Yep already got it

abrhambas01 commented 4 years ago

Sir the issue came back, why is it like this ? it still show someting like

c image

This is how it shows up in the vue devtools prop

Autem illo iure beat.asdasd klasjdas, askldja skldjdownload.jpg 2.44 KB"

abrhambas01 commented 4 years ago

should it give me a file name .. ?

abrhambas01 commented 4 years ago

anyone here who has made it show?

hanhdt commented 3 years ago

@abrhambas01 sorry, I have been busy lately. Did you resolve this issue?