-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9cbc87
commit 8225483
Showing
6 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script setup> | ||
import { useModalStack } from './modalStack' | ||
import { computed, provide } from 'vue' | ||
const props = defineProps({ | ||
index: Number, | ||
}) | ||
const modalStack = useModalStack() | ||
const modalContext = computed(() => { | ||
return modalStack.stack.value[props.index] | ||
}) | ||
provide('modalContext', modalContext) | ||
function handleEmittedEvent(event, ...args) { | ||
modalContext.value.emit(event, ...args) | ||
} | ||
</script> | ||
|
||
<template> | ||
<modalContext.component | ||
v-if="modalContext?.component" | ||
v-bind="modalContext.componentProps" | ||
@emit="handleEmittedEvent" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup> | ||
import { useModalStack } from './modalStack' | ||
import ModalResolver from './ModalResolver.vue' | ||
const modalStack = useModalStack() | ||
</script> | ||
|
||
<template> | ||
<slot /> | ||
|
||
<ModalResolver | ||
v-if="modalStack.stack.value.length" | ||
:index="0" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { getConfig, putConfig, resetConfig } from './config.js' | ||
import Modal from './Modal.vue' | ||
import ModalLink from './ModalLink.vue' | ||
import ModalRoot from './ModalRoot.vue' | ||
|
||
export { Modal, ModalLink, getConfig, putConfig, resetConfig } | ||
export { Modal, ModalLink, ModalRoot, getConfig, putConfig, resetConfig } |