-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dropdown component. Add hamburger menu for nomenclature citations…
… panel
- Loading branch information
José Luis Pereira
committed
Sep 27, 2022
1 parent
f44a9f3
commit c3248ee
Showing
6 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,58 @@ | ||
| <template> | ||
| <div class="relative inline"> | ||
| <button @click="toggleMenu"> | ||
| <slot name="button" /> | ||
| </button> | ||
| <ul | ||
| v-if="isVisible" | ||
| class=" | ||
| bg-base-foreground | ||
| absolute font-normal | ||
| text-sm | ||
| text-base-lighter | ||
| right-0 | ||
| z-10 | ||
| mt-2 | ||
| w-56 | ||
| origin-top-right | ||
| rounded-md | ||
| shadow-lg | ||
| ring-1 | ||
| ring-black | ||
| ring-opacity-5 | ||
| focus:outline-none" | ||
| > | ||
| <li | ||
| v-for="item in items" | ||
| :key="item.label" | ||
| class="block w-full px-4 py-2 text-left text-sm cursor-pointer hover:bg-secondary-color hover:bg-opacity-5 box-border" | ||
| @click="itemClicked(item)" | ||
| > | ||
| {{ item.label }} | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { ref } from 'vue' | ||
| defineProps({ | ||
| items: { | ||
| type: Array, | ||
| default: () => [] | ||
| } | ||
| }) | ||
| const isVisible = ref(false) | ||
| const toggleMenu = () => { | ||
| isVisible.value = !isVisible.value | ||
| } | ||
| const itemClicked = item => { | ||
| isVisible.value = false | ||
| item.action() | ||
| } | ||
| </script> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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