client: refactor super-menu component to composition API

This commit is contained in:
Johann150 2022-10-07 11:28:49 +02:00
parent 8311b30b4c
commit 64e3239566
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -23,21 +23,34 @@
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
<script lang="ts" setup>
type MenuItem = {
text: string;
icon?: string;
danger?: boolean;
active?: boolean;
i?: number;
} & (
{
type: 'a';
href: string;
target?: string;
} | {
type: 'button';
action(MouseEvent): void;
} | {
to: string;
}
);
export default defineComponent({
props: {
def: {
type: Array,
required: true,
},
grid: {
type: Boolean,
required: false,
default: false,
},
},
withDefaults(defineProps<{
def: {
title?: string;
items: MenuItem[];
}[];
grid?: boolean;
}>(), {
grid: false,
});
</script>