Merge PR 'client: refactor super-menu component to composition API' (#186)

Reviewed-on: FoundKeyGang/FoundKey#186
This commit is contained in:
Norm 2022-10-07 19:50:56 -04:00
commit f6a5459f91
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

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>