-
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.
Configurado menu em forma de componente
- Loading branch information
1 parent
0751eff
commit e481b7b
Showing
9 changed files
with
510 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
{ | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnType": false, | ||
"editor.formatOnSave": false, | ||
"[vue]": { | ||
"editor.formatOnType": false, | ||
"editor.formatOnSave": false | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"files.associations": { | ||
"*.css": "postcss" | ||
}, | ||
"editor.formatOnSave": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"typescript" | ||
] | ||
"javascriptvue", | ||
"typescript", | ||
"typescriptvue", | ||
"vue" | ||
], | ||
} |
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,5 @@ | ||
<template> | ||
<AppLayout> | ||
<DashboardTop> | ||
<NuxtPage /> | ||
</AppLayout> | ||
</DashboardTop> | ||
</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
Large diffs are not rendered by default.
Oops, something went wrong.
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,32 @@ | ||
<template> | ||
<div class="space-y-1"> | ||
<a v-for="item in navigation" :key="item.name" :href="item.href" :class="[item.current ? 'bg-gray-200 text-gray-900' : 'text-gray-700 hover:text-gray-900 hover:bg-gray-50', 'group flex items-center px-2 py-2 text-sm font-medium rounded-md']" :aria-current="item.current ? 'page' : undefined"> | ||
<component :is="item.icon" :class="[item.current ? 'text-gray-500' : 'text-gray-400 group-hover:text-gray-500', 'mr-3 flex-shrink-0 h-6 w-6']" aria-hidden="true" /> | ||
{{ item.name }} | ||
</a> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { type PropType } from 'vue' | ||
export interface Teams { | ||
name: String | ||
href: String | ||
bgColorClass: String | ||
} | ||
export interface Navigation { | ||
name: String | ||
href: String | ||
current: String | ||
} | ||
// eslint-disable-next-line no-unused-vars | ||
const props = defineProps({ | ||
teams: { | ||
type: Object as PropType<Teams>, | ||
required: false | ||
}, | ||
navigation: { | ||
type: Object as PropType<Navigation>, | ||
required: true | ||
} | ||
}) | ||
</script> |
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,79 @@ | ||
<template> | ||
<Menu as="div" class="relative inline-block px-3 text-left"> | ||
<div> | ||
<MenuButton class="group w-full rounded-md bg-gray-100 px-3.5 py-2 text-left text-sm font-medium text-gray-700 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 focus:ring-offset-gray-100"> | ||
<span class="flex w-full items-center justify-between"> | ||
<span class="flex min-w-0 items-center justify-between space-x-3"> | ||
<img class="h-10 w-10 flex-shrink-0 rounded-full bg-gray-300" src="https://images.unsplash.com/photo-1502685104226-ee32379fefbe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=3&w=256&h=256&q=80" alt="" /> | ||
<span class="flex min-w-0 flex-1 flex-col"> | ||
<span class="truncate text-sm font-medium text-gray-900">Jessy Schwarz</span> | ||
<span class="truncate text-sm text-gray-500">@jessyschwarz</span> | ||
</span> | ||
</span> | ||
<ChevronUpDownIcon class="h-5 w-5 flex-shrink-0 text-gray-400 group-hover:text-gray-500" aria-hidden="true" /> | ||
</span> | ||
</MenuButton> | ||
</div> | ||
<transition enter-active-class="transition ease-out duration-100" enter-from-class="transform opacity-0 scale-95" enter-to-class="transform opacity-100 scale-100" leave-active-class="transition ease-in duration-75" leave-from-class="transform opacity-100 scale-100" leave-to-class="transform opacity-0 scale-95"> | ||
<MenuItems class="absolute right-0 left-0 z-10 mx-3 mt-1 origin-top divide-y divide-gray-200 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">View profile</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Settings</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Notifications</a> | ||
</MenuItem> | ||
</div> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Get desktop app</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Support</a> | ||
</MenuItem> | ||
</div> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Logout</a> | ||
</MenuItem> | ||
</div> | ||
</MenuItems> | ||
</transition> | ||
</Menu> | ||
</template> | ||
<script setup lang="ts"> | ||
import { type PropType } from 'vue' | ||
import { | ||
Menu, | ||
MenuButton, | ||
MenuItem, | ||
MenuItems | ||
} from '@headlessui/vue' | ||
import { ChevronUpDownIcon } from '@heroicons/vue/20/solid' | ||
export interface Teams { | ||
name: String | ||
href: String | ||
bgColorClass: String | ||
} | ||
export interface Navigation { | ||
name: String | ||
href: String | ||
current: String | ||
} | ||
// eslint-disable-next-line no-unused-vars | ||
const props = defineProps({ | ||
teams: { | ||
type: Object as PropType<Teams>, | ||
required: false | ||
}, | ||
navigation: { | ||
type: Object as PropType<Navigation>, | ||
required: false | ||
} | ||
}) | ||
</script> |
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,70 @@ | ||
<template> | ||
<Menu as="div" class="relative ml-3"> | ||
<div> | ||
<MenuButton class="flex max-w-xs items-center rounded-full bg-white text-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2"> | ||
<span class="sr-only">Open user menu</span> | ||
<img class="h-8 w-8 rounded-full" src="https://images.unsplash.com/photo-1502685104226-ee32379fefbe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" /> | ||
</MenuButton> | ||
</div> | ||
<transition enter-active-class="transition ease-out duration-100" enter-from-class="transform opacity-0 scale-95" enter-to-class="transform opacity-100 scale-100" leave-active-class="transition ease-in duration-75" leave-from-class="transform opacity-100 scale-100" leave-to-class="transform opacity-0 scale-95"> | ||
<MenuItems class="absolute right-0 z-10 mt-2 w-48 origin-top-right divide-y divide-gray-200 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">View profile</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Settings</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Notifications</a> | ||
</MenuItem> | ||
</div> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Get desktop app</a> | ||
</MenuItem> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Support</a> | ||
</MenuItem> | ||
</div> | ||
<div class="py-1"> | ||
<MenuItem v-slot="{ active }"> | ||
<a href="#" :class="[active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm']">Logout</a> | ||
</MenuItem> | ||
</div> | ||
</MenuItems> | ||
</transition> | ||
</Menu> | ||
</template> | ||
<script setup lang="ts"> | ||
import { type PropType } from 'vue' | ||
import { | ||
Menu, | ||
MenuButton, | ||
MenuItem, | ||
MenuItems | ||
} from '@headlessui/vue' | ||
export interface Teams { | ||
name: String | ||
href: String | ||
bgColorClass: String | ||
} | ||
export interface Navigation { | ||
name: String | ||
href: String | ||
current: String | ||
} | ||
// eslint-disable-next-line no-unused-vars | ||
const props = defineProps({ | ||
teams: { | ||
type: Object as PropType<Teams>, | ||
required: false | ||
}, | ||
navigation: { | ||
type: Object as PropType<Navigation>, | ||
required: false | ||
} | ||
}) | ||
</script> |
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