-
Main idea: Add levels (namespace) for displaying modal windows. This approach can help unify this library. For example, I thought a lot about displaying notifications, like in the following screenshot: To some extent, this is also a set of components that are shown in a *separate layout, but with a slightly different specification, a slightly different display. But this can be changed more easily via As a result:
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
<template>
<container namespace = "notification"/>
<container /> <!--Default container-->
</template>
<script setup>
import {container} from "jenesius-vue-modal"
</script> For container i think its more simple solution. namespace("notification").pushModal(modal)
pushModal(Modal) Or pushModal(modal, {}, { namespace: "notification" }) // Looks more better One of the options I suggested. |
Beta Was this translation helpful? Give feedback.
-
Also we need to create analog for modalQueue. const queue = getQueueByNamespace("notification"); // reactive [] So, in result we can create our own layout. modalQueue.value.push(markRaw(modal)); To: const modalQueue = getQueueByNamespace(options.namespace):
modalQueue.value.push(markRaw(modal)); |
Beta Was this translation helpful? Give feedback.
-
Don't forgot about getCurrentModal. We can pass namespace name as second param. |
Beta Was this translation helpful? Give feedback.
-
As a result:
|
Beta Was this translation helpful? Give feedback.
-
I believe that on the basis of this task it is possible to implement adequate storage of modal windows. Also in the modal window you need to specify the namespace to which it belongs. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Now there is a problem with storing modal windows. We store in both modalQueue and Store. It is not right. Removing a modal window from storage should automatically remove it from the queue. |
Beta Was this translation helpful? Give feedback.
-
I think that for this particular task you can change |
Beta Was this translation helpful? Give feedback.
As a result:
namespace: string