Answer the question
In order to leave comments, you need to log in
How to add modal inside bootstrap-vue tag when opening bootstrap-vue?
I am using bootstrap-vue modal:
codesandbox:
<template>
<b-button variant="link" class="btn-remove" @click="removeItemFromOrder(index)">
Remove item
</b-button>
</template>
<script>
export default {
name: "HelloWorld",
methods: {
removeItemFromOrder: async function (position) {
let self = this
const h = this.$createElement
const titleVNode = h('div', { domProps: { innerHTML: '<h2>Remove this item?</h2>' } })
const messageVNode = h('div', { class: ['modal-complete'] }, [
h('div', {
domProps: {
innerHTML: '<h2>Remove this item?</h2>'+
'<span class="popup-meta">'+
'Are you sure you want to remove this item?'+
'</span>'
}
})
])
this.$bvModal.msgBoxConfirm([messageVNode], {
title: [],
centered: true,
modalClass: 'success-popup',
hideHeader:true,
footerClass: 'd-flex justify-content-center align-items-center',
cancelVariant: 'outline-danger',
okVariant: 'danger',
okTitle: 'YES',
cancelTitle: 'NO',
ststic: false
})
.then(async function (result) {
if (result) {
self.currentOrder.items.splice(position, 1)
await self.sync()
}
})
.catch(err => {
// An error occurred
})
},
}
};
</script>
body
. app
or anywhere else in the template\tag ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question