I have a vue component that looks like this:
<template>
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="true" data-delay="5000">
<!-- HTML Clipped -->
<div class="toast-body">{{message}}</div>
</div>
</template>
<script>
export default {
props: ['title', 'message']
}
</script>
I then have an eventListener that listens for messages sent via postMessage. This does work, but I don't think mount is the correct way to do what I want.
window.addEventListener('message', e => {
let toastComp = Vue.extend(Toast)
let toast = new toastComp({
propsData: {
message: 'hello'
}
}).$mount('.toast-container')
})
What I am looking for, is for vue to append the component to the .toast-container element instead of replacing the element. How can this be done?