<template>
  <div class="capital-info">

  </div>
</template>

<script lang="ts">
import { defineComponent, ref, PropType } from 'vue';

interface Key {
    [propName: string]: string;
}

export default defineComponent({
    name: 'first-menu',
    props: {
        list: {
            default: [],
            type: Object as PropType<Key[]>,
        },
        value: {
            // 需要绑定的值得 key
            default: '',
            type: String,
        },
    },
    components: {},
    setup(props, context) {
        const current = ref<string[]>(['0']);
        function menuClick(value: any) {
            const index = +value.key;
            context.emit('selectMenu', props.list[index]);
        }
        return {
            current,
            menuClick,
        };
    },
});
</script>

<style lang="less">
.capital-info {
}
</style>;
