From 8ef6526fa73fcc3a7685e0dc49235ce4ad32fb6d Mon Sep 17 00:00:00 2001 From: Dmitri <19738862+Dmitri-2@users.noreply.github.com> Date: Wed, 31 Aug 2022 10:14:18 -0700 Subject: [PATCH] Add basic modal component --- docs/.vitepress/config.ts | 2 +- .../modal/examples/ModalExample.vue | 25 ++++++- docs/components/modal/modal.md | 36 +++++++++- src/components/Modal/Modal.vue | 65 +++++++++++-------- 4 files changed, 97 insertions(+), 31 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index d81f580..a3733c3 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -42,6 +42,7 @@ function getComponents() { { text: 'Tabs', link: '/components/tabs/tabs.md' }, { text: 'ListGroup', link: 'components/listGroup/listGroup.md' }, { text: 'Toast', link: 'components/toast/toast.md' }, + { text: 'Modal', link: 'components/modal/modal.md' }, { text: '- Accordion', link: 'components/accordion/accordion.md' }, { text: '- Avatar', link: 'components/avatar/avatar.md' }, @@ -50,7 +51,6 @@ function getComponents() { { text: '- Card', link: 'components/card/card.md' }, { text: '- Carousel', link: 'components/carousel/carousel.md' }, { text: '- Footer', link: 'components/footer/footer.md' }, - { text: '- Modal', link: 'components/modal/modal.md' }, { text: '- Navbar', link: 'components/navbar/navbar.md' }, { text: '- Pagination', link: 'components/pagination/pagination.md' }, { text: '- Progress', link: 'components/progress/progress.md' }, diff --git a/docs/components/modal/examples/ModalExample.vue b/docs/components/modal/examples/ModalExample.vue index aea1c27..df2b134 100644 --- a/docs/components/modal/examples/ModalExample.vue +++ b/docs/components/modal/examples/ModalExample.vue @@ -1,6 +1,29 @@ # Modal +### Demo + + + ```vue ``` - +### Slot Properties + +Modal slots recieve the following functions to interact with the modal: +1. `show` = show the modal +2. `hide` = hide the modal +3. `toggle` = toggles the modal from current state (e.g. if shown, then hide) diff --git a/src/components/Modal/Modal.vue b/src/components/Modal/Modal.vue index aa38a79..28b10d0 100644 --- a/src/components/Modal/Modal.vue +++ b/src/components/Modal/Modal.vue @@ -1,37 +1,36 @@