cosmos-explorer/src/components/dynamic/ObjectHorizontalElement.vue
2023-05-07 09:07:33 +08:00

27 lines
757 B
Vue

<script lang="ts" setup>
import DynamicComponent from './DynamicComponent.vue';
import { select } from './index';
import { ref} from 'vue'
const props = defineProps(['value']);
const tab = ref('');
const changeTab = (val: string) => {
tab.value = val;
};
</script>
<template>
<div>
<div class="tabs">
<a class="tab tab-bordered text-gray-400 uppercase"
v-for="(item, index) of value" :value="index"
:class="{ 'tab-active': tab === String(index) }"
@click="changeTab(String(index))"
>{{ index }}</a>
</div>
<div class="min-h-[25px] mt-4">
<div v-for="(v, k) of value" :value="k">
<DynamicComponent :value="v" v-show=" tab === String(k)"/>
</div>
</div>
</div>
</template>