/* * @Description: 左侧编辑 / 评论 / 提交记录 * @Author: tangjiang * @Date: 2019-11-19 11:35:30 * @Last Modified by: tangjiang * @Last Modified time: 2019-11-19 19:07:02 */ import './index.scss'; import React, { useState } from 'react'; import { Tabs } from 'antd'; import EditorTab from './editorTab'; import PrevTab from './prevTab'; import CommitTab from './commitTab'; const { TabPane } = Tabs; function LeftPane (props) { const [defaultActiveKey, setDefaultActiveKey] = useState('editor'); const tabArrs = [ { title: '编辑', key: 'editor', content: () }, { title: '预览', key: 'prev', content: () }, // { title: '提交记录', key: 'commit', content: () }, ]; const tabs = tabArrs.map((tab) => { const Comp = tab.content; return ( { Comp } ) }); // tab切换时 const handleTabChange = (key) => { setDefaultActiveKey(key); } // 执行表单提交函数 return ( { tabs } ) }; export default LeftPane;