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
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>
Original file line number Diff line number Diff line change 1010
1111 <HMenuContainer
1212 :active =" $state.active"
13+ v-bind =" $attrs"
14+ :position =" $props.position"
1315 @click =" handleClose"
1416 >
1517 <slot />
1820</template >
1921
2022<script setup>
21- import { reactive } from ' vue' ;
23+ import { reactive , useAttrs } from ' vue' ;
2224import HMenuContainer from ' ./menu-container.vue' ;
2325
26+ const $props = defineProps ({
27+ position: {
28+ type: String ,
29+ default: ' bottom-center' ,
30+ },
31+ });
32+
2433const $state = reactive ({
2534 active: false ,
2635});
2736
37+ const $attrs = useAttrs ();
38+
2839const handleClose = () => {
2940 $state .active = false ;
3041};
You can’t perform that action at this time.
0 commit comments