<template>
<div class="tab">
<input v-for="(item,index) in tabButton" @click="FnStart(index)" :key="item.ID" :class="index===tabIndex?'btn ac':'ac'" type="button" :value="item.text"/>
<div v-for="(item,index) in tabCont" :key="item.ID" :style="{display:tabIndex===index?'block':'none'}" class="item">{
{item.text}}</div>
</div>
</template>
<script setup lang="ts">
import {ref} from "vue";
interface info{
ID:string,
text:string
}
const tabIndex=ref<number>(0)
const tabButton=ref<info[]>([
{
ID:'btn1',
text:'按钮一'
},
{
ID:'btn2',
text:'按钮二'
},
{
ID:'btn3',
text:&#
Vue3选项卡
最新推荐文章于 2024-05-31 01:45:16 发布