Skip to content

Commit

Permalink
fix(vmenu): remove accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
reynaldi_rangga committed Dec 20, 2021
1 parent c7f8d05 commit f9bbc54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
25 changes: 2 additions & 23 deletions src/components/VMenu/VMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {ChevronRightIcon} from '@heroicons/vue/outline';
import VMenuTooltip from './VMenuTooltip.vue';
import VMenuItem from './VMenuItem.vue';
import {useRouter} from 'vue-router';
import {number} from 'yup/lib/locale';
const props = defineProps({
menu: {
Expand Down Expand Up @@ -48,8 +49,6 @@ const props = defineProps({
});
const router = useRouter();
const emit = defineEmits([]);
const elements = ref<any>([]);
const {menu, mini, dark, classMenuParent} = toRefs(props);
Expand Down Expand Up @@ -83,23 +82,11 @@ const isActive = (path: any) => {
const route = path.to.split('/');
return route[2] === currentRoute[2];
};
const hideOther = (id: any) => {
const items = elements.value.filter((elm: any) => {
return elm.getAttribute('data-id') !== id.toString();
});
items.forEach((elm: any) => elm.click());
};
const doClose = (close: any) => {
console.log(close);
console.log('a');
close();
};
</script>

<template>
<template v-if="menu">
<Disclosure v-if="menu.children" v-slot="{open, close}">
<Disclosure v-if="menu.children" v-slot="{open}">
<DisclosureButton
v-slot="{open}"
class="
Expand Down Expand Up @@ -175,14 +162,6 @@ const doClose = (close: any) => {
"
/>
</DisclosurePanel>
<button
:ref="(el) => (elements[menu.text] = el)"
:data-id="menu.to"
@click="doClose(close)"
>
s
</button>
<div @show="hideOther(menu.to)" v-show="false">a</div>
</Disclosure>
<router-link
v-else
Expand Down
3 changes: 2 additions & 1 deletion src/components/VNavDrawer/VNavDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ const bgColor = computed(() =>
:dark="dark"
:bg-color="expandColor"
:color="color"
/>
>
</v-menu>
</div>
<div class="append flex flex-col justify-center">
<slot name="append" />
Expand Down

0 comments on commit f9bbc54

Please sign in to comment.