mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
Some checks failed
Test Master / install-and-build (push) Has been cancelled
Test Master / Unit tests (18.x) (push) Has been cancelled
Test Master / Unit tests (20.x) (push) Has been cancelled
Test Master / Unit tests (22.4) (push) Has been cancelled
Test Master / Lint (push) Has been cancelled
Test Master / Notify Slack on failure (push) Has been cancelled
37 lines
809 B
Vue
37 lines
809 B
Vue
<script lang="ts">
|
|
import type { PropType } from 'vue';
|
|
import { defineComponent } from 'vue';
|
|
import { useUIStore } from '@/stores/ui.store';
|
|
import { mapStores } from 'pinia';
|
|
import type { ModalKey } from '@/Interface';
|
|
|
|
export default defineComponent({
|
|
name: 'ModalRoot',
|
|
props: {
|
|
name: {
|
|
type: String as PropType<ModalKey>,
|
|
required: true,
|
|
},
|
|
keepAlive: {
|
|
type: Boolean,
|
|
},
|
|
},
|
|
computed: {
|
|
...mapStores(useUIStore),
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="uiStore.modalsById[name].open || keepAlive">
|
|
<slot
|
|
:modal-name="name"
|
|
:active="uiStore.isModalActiveById[name]"
|
|
:open="uiStore.modalsById[name].open"
|
|
:active-id="uiStore.modalsById[name].activeId"
|
|
:mode="uiStore.modalsById[name].mode"
|
|
:data="uiStore.modalsById[name].data"
|
|
></slot>
|
|
</div>
|
|
</template>
|