import React, { useState } from 'react'; import { Button } from 'antd'; import styles from './index.less'; import CustomButton from '../../../components/CustomButton';

class Index extends React.Component { constructor(props) { super(props); this.state = { btnList: [ { active: true, id: 1, content: '通用安全基线', }, { active: false, id: 2, content: '共有云安全基线', }, { active: false, id: 3, content: '软件平台安全基线', }, { active: false, id: 4, content: '其他基线', }, ], }; }

render() { return (

已发布基线

{this.state.btnList.map((item) => { return ( ); })}
); } }

export default Index;

React 函数式组件转换为类式组件示例

原文地址: https://www.cveoy.top/t/topic/fAHx 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录