app.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import ReactDOM from 'react-dom';
  3. import AgileTCEditor from './kityminderEditor';
  4. import { FromChooseItem } from './index'
  5. import { Button } from 'antd'
  6. // 本地调试DEMO
  7. class App extends React.Component {
  8. constructor(props) {
  9. super(props);
  10. this.state = {
  11. tab: 1,
  12. };
  13. }
  14. handleClick = (tab, show) => {
  15. this.setState({ tab });
  16. setTimeout(() => {
  17. this.setState({ show });
  18. }, 100);
  19. };
  20. render() {
  21. const { tab } = this.state;
  22. let content = null;
  23. if (tab === 1) {
  24. content = <AgileTCEditor />;
  25. } else {
  26. content = <FromChooseItem
  27. renderFormList={[
  28. {
  29. name: '描述',
  30. colSpan: 24,
  31. key: 'remark',
  32. type: 'textarea',
  33. placeholder: '请填写描述'
  34. }
  35. ]}
  36. valueData={{}}
  37. labelWidth={'104px'}
  38. onChange={(key, value) => console.log(111)}
  39. />;
  40. }
  41. return (
  42. <div>
  43. <Button onClick={() => this.handleClick(1, false)}>1</Button>
  44. <button onClick={() => this.handleClick(2, true)}>2</button>
  45. <div>{content}</div>
  46. </div>
  47. );
  48. }
  49. }
  50. ReactDOM.render(<App />, document.getElementById('app'));