import React, { Component } from 'react'; import { Modal, Collapsible, Button, Table } from '@douyinfe/semi-ui'; class Demo extends React.Component { constructor(props) { super(props); this.state = { isOpen: false, visible: false, content: null, contentIndex: 0 }; this.showDialog = this.showDialog.bind(this); this.handleOk = this.handleOk.bind(this); this.handleCancel = this.handleCancel.bind(this); this.toggle = this.toggle.bind(this); this.changeContent = this.changeContent.bind(this); this.contents = [ , text, }, { title: 'Age', dataIndex: 'age', width: 150, render: (text, record) => text, }, { title: 'Address', dataIndex: 'address', render: (text, record) => text, }, { render: (text, record) => (

Show Info

), width: 150, }, ]} /> ]; } showDialog() { this.setState({ visible: true, }); } handleOk(e) { this.setState({ visible: false, }); } handleCancel(e) { this.setState({ visible: false, }); } toggle() { this.setState({ isOpen: !this.state.isOpen }); } changeContent() { this.setState({ contentIndex: (this.state.contentIndex + 1) % this.contents.length, }); } componentDidMount() { this.changeContent(); } render() { const { isOpen, content, contentIndex } = this.state; return (
{this.contents[contentIndex]}
); } } export default () => ;