0

使用antd中tabs的嵌套,发现在tabPosition为left中嵌套top,会出现切换tab不显示内容的bug

import { Tabs, Select } from 'antd';
const TabPane = Tabs.TabPane;
const Option = Select.Option;

const Tab1 = React.createClass({
  getInitialState() {
    return {
    };
  },
  render() {
    return (
      <div>
        <Tabs tabPosition={"left"}>
          <TabPane tab="Tab 1" key="1">
              <Tab2 />
              /*  在这里嵌入一个tab2子标签,可是tab2子标签切换tab的时候,
                  <TabPane tab="Tab 2" key="2">Content of Tab 2</TabPane>
                  <TabPane tab="Tab 3" key="3">Content of Tab 3</TabPane>
                  的内容都不会显示
              */
          </TabPane>
        </Tabs>
      </div>
    );
  },
});

ReactDOM.render(<Tab1 />, mountNode);
import { Tabs, Select } from 'antd';
const TabPane = Tabs.TabPane;
const Option = Select.Option;

const Tab2 = React.createClass({
  getInitialState() {
    return {
    };
  },
  render() {
    return (
      <div>
        <Tabs tabPosition={"top"}>
          <TabPane tab="Tab 1" key="1">Content of Tab 1</TabPane>
          <TabPane tab="Tab 2" key="2">Content of Tab 2</TabPane>
          <TabPane tab="Tab 3" key="3">Content of Tab 3</TabPane>
        </Tabs>
      </div>
    );
  },
});

1 个回答

0

bug 的话请提 issue,并附上可重现在线 demo