hotfix in Modal.js

This commit is contained in:
SimonGschnell
2024-05-08 14:35:41 +02:00
parent 6fa5ff81d6
commit fd8e49c11f
+13 -1
View File
@@ -68,6 +68,13 @@ export default {
slots.title = () => title;
if (footer !== undefined)
slots.footer = () => footer;
// little hack to check whether primevue is included in the app or not
let includedPrimevue = false;
if(typeof primevue !== 'undefined'){
includedPrimevue = true;
}
return new Promise((resolve,reject) => {
const instance = Vue.createApp({
setup() {
@@ -80,6 +87,7 @@ export default {
},
mounted() {
this.$refs.modal.show();
},
beforeUnmount() {
if (this.$refs.modal)
@@ -90,8 +98,12 @@ export default {
}
});
const wrapper = document.createElement("div");
if (primevue)
// if(primevue) --> won't work because primevue is not defined in this scope and promise would be rejected
if (includedPrimevue){
instance.use(primevue.config.default, {zIndex: {overlay: 9999}})
}
instance.use(Phrasen); // TODO(chris): find a more dynamic way
instance.mount(wrapper);
document.body.appendChild(wrapper);