mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
hotfix in Modal.js
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user