[Vuejs]-Edit row in PrimeVue dataTable strips image tag

0👍

UPDATE I have found a workaround but I am still open to implementing a better solution.

<Column field="image_url" header="Image" :editable="false">
    <template #body="{data}">
        <img :src="data.image_url" :alt="data.image_url" class="product-image"/>
    </template>
    <template #editor="slotProps">
        <div v-html="renderHtml(slotProps)"></div>
    </template>
</Column>
renderHtml(data) {
    let src = data.data.image_url,
    alt = data.data.image_url;

    return '<img src="' + src + '" alt="' + alt +'" class="product-image" />';
}

Leave a comment