Skip to content

Commit

Permalink
feat(v-dropdown): new props: hideLabel and wrapperClass
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Oct 25, 2021
1 parent 5789648 commit e958a81
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/VDropdown/VDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ const props = defineProps({
type: String,
default: '',
},
hideLabel: {
type: Boolean,
default: false,
},
wrapperClass: {
type: String,
default: '',
},
});
const {label, items, right, btnProps, ...rest} = toRefs(props);
Expand All @@ -108,12 +116,12 @@ const emit = defineEmits(['update:modelValue']);
</script>

<template>
<Menu as="div" class="relative inline-block text-left">
<Menu as="div" class="relative inline-block text-left" :class="wrapperClass">
<div>
<MenuButton as="template">
<v-btn v-bind="{...restBtnProps, ...btnProps}">
<slot name="btn" :label="label">
<slot name="label">
<slot v-if="!hideLabel" name="label">
{{ label }}
</slot>
<slot name="icon">
Expand Down Expand Up @@ -147,7 +155,7 @@ const emit = defineEmits(['update:modelValue']);
:class="[
widthClass,
right ? 'right-0' : 'left-0',
top ? 'bottom-12' : 'top-0',
top ? 'bottom-12' : 'top-8',
]"
>
<div class="px-1 py-1">
Expand Down

0 comments on commit e958a81

Please sign in to comment.