File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Componente visual para o botão
30
30
const click = () => console .log (" Clickado" );
31
31
return { click };
32
32
},
33
- template: ` <h-menu position="none ">
33
+ template: ` <h-menu position="bottom-right ">
34
34
<template #trigger={handleTrigger}><h-button @click="handleTrigger">Open</h-button></template>
35
35
<h-menu-item @click="click">First Element</h-menu-item>
36
36
<h-menu-item active>Second Element</h-menu-item>
Original file line number Diff line number Diff line change 10
10
11
11
<HMenuContainer
12
12
:active =" $state.active"
13
+ v-bind =" $attrs"
14
+ :position =" $props.position"
13
15
@click =" handleClose"
14
16
>
15
17
<slot />
18
20
</template >
19
21
20
22
<script setup>
21
- import { reactive } from ' vue' ;
23
+ import { reactive , useAttrs } from ' vue' ;
22
24
import HMenuContainer from ' ./menu-container.vue' ;
23
25
26
+ const $props = defineProps ({
27
+ position: {
28
+ type: String ,
29
+ default: ' bottom-center' ,
30
+ },
31
+ });
32
+
24
33
const $state = reactive ({
25
34
active: false ,
26
35
});
27
36
37
+ const $attrs = useAttrs ();
38
+
28
39
const handleClose = () => {
29
40
$state .active = false ;
30
41
};
You can’t perform that action at this time.
0 commit comments