parent
b73449f9ea
commit
623df3e5ff
@ -1,6 +1,53 @@ |
|||||||
<template> |
<template> |
||||||
|
<div class="flex gap-2"> |
||||||
|
<h2 |
||||||
|
v-t="'Pages'" |
||||||
|
class="mr-auto" |
||||||
|
/> |
||||||
|
|
||||||
|
<BaseButton |
||||||
|
v-if="menuItems.length" |
||||||
|
icon="dots-vertical" |
||||||
|
only-icon |
||||||
|
popup-identifier="page-menu" |
||||||
|
type="black" |
||||||
|
@click="toggleMenu" |
||||||
|
/> |
||||||
|
|
||||||
|
<BaseMenu |
||||||
|
v-if="menuItems.length" |
||||||
|
id="page-menu" |
||||||
|
ref="menu" |
||||||
|
:model="menuItems" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<hr /> |
||||||
|
|
||||||
<router-view /> |
<router-view /> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script setup> |
<script setup> |
||||||
</script> |
import BaseButton from "../basecomponents/BaseButton.vue" |
||||||
|
import BaseMenu from "../basecomponents/BaseMenu.vue" |
||||||
|
import { provide, ref, watch } from "vue" |
||||||
|
import { useRoute } from "vue-router" |
||||||
|
|
||||||
|
const route = useRoute() |
||||||
|
|
||||||
|
const menu = ref(null) |
||||||
|
|
||||||
|
const menuItems = ref([]) |
||||||
|
|
||||||
|
provide("layoutMenuItems", menuItems) |
||||||
|
|
||||||
|
watch( |
||||||
|
() => route.name, |
||||||
|
() => { |
||||||
|
menuItems.value = [] |
||||||
|
}, |
||||||
|
{ inmediate: true }, |
||||||
|
) |
||||||
|
|
||||||
|
const toggleMenu = (event) => menu.value.toggle(event) |
||||||
|
</script> |
Loading…
Reference in new issue