1.代码块
<template>
<div class="cont">
<input v-for="(item,index) in tabbutton" :key="item.ID" @click="Fnstart(index)" :class="selectindex===index?'button-item ac':'button-item'" type="button" :value="item.text">
<div v-for="(item,index) in conbutton" :key="item.ID" class="con-item" :style="{display:selectindex===index?'block':'none'}">{
{item.text}}</div>
</div>
</template>
<script setup lang="ts">
import {ref} from 'vue'
interface info{
ID:string,
text:string
}
const selectindex=ref<number>(0)
const tabbutton=ref<info[]>([
{
ID:"btn1",
text:"按钮一"
},
{
ID:"btn2",
text:"按钮二&