12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import React from 'react';
- import ReactDOM from 'react-dom';
- import AgileTCEditor from './kityminderEditor';
- import { FromChooseItem } from './index'
- import { Button } from 'antd'
- // 本地调试DEMO
- class App extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- tab: 1,
- };
- }
- handleClick = (tab, show) => {
- this.setState({ tab });
- setTimeout(() => {
- this.setState({ show });
- }, 100);
- };
- render() {
- const { tab } = this.state;
- let content = null;
- if (tab === 1) {
- content = <AgileTCEditor />;
- } else {
- content = <FromChooseItem
- renderFormList={[
- {
- name: '描述',
- colSpan: 24,
- key: 'remark',
- type: 'textarea',
- placeholder: '请填写描述'
- }
- ]}
- valueData={{}}
- labelWidth={'104px'}
- onChange={(key, value) => console.log(111)}
- />;
- }
- return (
- <div>
- <Button onClick={() => this.handleClick(1, false)}>1</Button>
- <button onClick={() => this.handleClick(2, true)}>2</button>
- <div>{content}</div>
- </div>
- );
- }
- }
- ReactDOM.render(<App />, document.getElementById('app'));
|