forked from FoundKeyGang/FoundKey
client: refactor super-menu component to composition API
This commit is contained in:
parent
8311b30b4c
commit
64e3239566
1 changed files with 27 additions and 14 deletions
|
@ -23,21 +23,34 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from 'vue';
|
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({
|
withDefaults(defineProps<{
|
||||||
props: {
|
def: {
|
||||||
def: {
|
title?: string;
|
||||||
type: Array,
|
items: MenuItem[];
|
||||||
required: true,
|
}[];
|
||||||
},
|
grid?: boolean;
|
||||||
grid: {
|
}>(), {
|
||||||
type: Boolean,
|
grid: false,
|
||||||
required: false,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue