Skip to content

Commit

Permalink
fix: navdrawer props
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhsanf committed Nov 16, 2021
1 parent 4f4419b commit 89bc9af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/components/VMenu/VMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ const props = defineProps({
type: String,
default: '',
},
isParentActive: {
type: Boolean,
default: false
classMenuParent: {
type: String,
default: 'text-primary-600 bg-grey-700'
}
});
const emit = defineEmits([]);
const {menu, mini, dark, isParentActive} = toRefs(props);
const {menu, mini, dark, classMenuParent} = toRefs(props);
const panel = ref<HTMLDivElement | null>(null);
Expand All @@ -66,10 +66,11 @@ const textColor = computed(() =>
);
const openClass = (isOpen: boolean) => {
console.log(classMenuParent.value)
if (dark.value) {
return isOpen && isParentActive.value ? 'text-grey-600 bg-grey-700' : isOpen ? 'text-primary-600 bg-gray-700' : '';
return isOpen ? `${classMenuParent.value}` : '';
}
return isOpen && isParentActive.value ? 'text-grey-600 bg-grey-700' : isOpen ? 'text-primary-600' : '';
return isOpen ? `${classMenuParent.value}` : '';
};
const scrollHeight = computed(() => (panel as any).value?.el?.scrollHeight);
Expand Down
2 changes: 1 addition & 1 deletion src/components/VNavDrawer/VNavDrawer.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
component: MyNavbarDrawer,
argTypes: {},
args: {
isParentActive: true,
classMenuParent: 'text-grey-600 bg-gray-700',
modelValue: '',
type: 'text',
placeholder: 'Type...',
Expand Down
10 changes: 5 additions & 5 deletions src/components/VNavDrawer/VNavDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const props = defineProps({
type: String,
default: '',
},
isParentActive: {
type: Boolean,
default: false
classMenuParent: {
type: String,
default: 'text-primary-600 bg-gray-700'
}
});
const {modelValue, mini, menus, logoProps, dark, color, hideToggle, isParentActive} =
const {modelValue, mini, menus, logoProps, dark, color, hideToggle, classMenuParent} =
toRefs(props);
const emit = defineEmits(['update:modelValue', 'update:mini', 'toggle:click']);
Expand Down Expand Up @@ -140,7 +140,7 @@ const bgColor = computed(() =>
<div class="mt-5 flex-grow overflow-auto">
<v-menu
v-for="(menu, i) in menus"
:isParentActive="isParentActive"
:classMenuParent="classMenuParent"
:key="i"
:menu="menu"
:mini="mini"
Expand Down

0 comments on commit 89bc9af

Please sign in to comment.