import { useState } from "react"
import "./contor.less"
interface demo {
id: string;
text: string;
}
export default function Contact() {
const [Array] = useState<demo[]>([
{
id: '1',
text: "按钮一"
},
{
id: '2',
text: "按钮二"
},
{
id: '3',
text: "按钮三"
},
])
const [context] = useState<demo[]>([
{
id: '1',
text: "内容一"
},
{
id: '2',
text: "内容二"
},
{
id: '3',
text: "内容三"
},
])
const [zhi, setZhi] = useState<number>()
const FnNow = (index: number) => {
setZhi(index)
}
return (
<div className="tab">
{Array.map((item, index) => <input type='button' className={zhi === index ? "item ac" : "item"} key={item.id} v
react hook选项卡
于 2022-04-02 10:16:05 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)