I need to bind HTML data to VueJS popup. I am using bootstrap vue for showing custom popup. I have to bind some dynamic HTML data to the popup. Currently, it was binding as a string type which shows the HTML tags too as the content.
import { BootstrapVue } from "bootstrap-vue";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
Vue.use(BootstrapVue);
methods: {
AnnouncementEventClick(id, category) {
var full_description = null;
if (category == "announcement") {
this.AnnouncementList.forEach(function (announcement) {
if (announcement.id == id) {
full_description = announcement.announcementEvents.full_description;
}
});
}
this.desc = full_description;
this.$bvModal.show("modal-scrollable");
},
}
<template>
<div>
<b-modal id="modal-scrollable" scrollable hide-footer hide-header>
{{ desc }}
<b-button class="mt-3" block @click="$bvModal.hide('modal-scrollable')"
>OK</b-button
>
</b-modal>
</div>
</template>
In the code 'full_description' is the dynamic content that I need to bind.
Solution :