| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <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>;
|