forked from FoundKeyGang/FoundKey
Merge PR 'client: refactor super-menu component to composition API' (#186)
Reviewed-on: FoundKeyGang/FoundKey#186
This commit is contained in:
commit
f6a5459f91
1 changed files with 27 additions and 14 deletions
|
@ -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: {
|
||||
withDefaults(defineProps<{
|
||||
def: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
grid: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
title?: string;
|
||||
items: MenuItem[];
|
||||
}[];
|
||||
grid?: boolean;
|
||||
}>(), {
|
||||
grid: false,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue