Skip to content

Commit 5d960ca

Browse files
committed
fix: menu
1 parent 0b6830c commit 5d960ca

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/atoms/menu/menu.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Componente visual para o botão
3030
const click = () => console.log("Clickado");
3131
return { click };
3232
},
33-
template: `<h-menu position="none">
33+
template: `<h-menu position="bottom-right">
3434
<template #trigger={handleTrigger}><h-button @click="handleTrigger">Open</h-button></template>
3535
<h-menu-item @click="click">First Element</h-menu-item>
3636
<h-menu-item active>Second Element</h-menu-item>

src/components/atoms/menu/menu.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
<HMenuContainer
1212
:active="$state.active"
13+
v-bind="$attrs"
14+
:position="$props.position"
1315
@click="handleClose"
1416
>
1517
<slot />
@@ -18,13 +20,22 @@
1820
</template>
1921

2022
<script setup>
21-
import { reactive } from 'vue';
23+
import { reactive, useAttrs } from 'vue';
2224
import HMenuContainer from './menu-container.vue';
2325
26+
const $props = defineProps({
27+
position: {
28+
type: String,
29+
default: 'bottom-center',
30+
},
31+
});
32+
2433
const $state = reactive({
2534
active: false,
2635
});
2736
37+
const $attrs = useAttrs();
38+
2839
const handleClose = () => {
2940
$state.active = false;
3041
};

0 commit comments

Comments
 (0)