ant-design/components/tabs/demo/position.md
Shawn Sit 2e0424d3b2 Translation tab title (#2815)
* translated doc of tab title

* fixs: misspell

* fixs: misspell

* remove full stop
2016-08-23 14:15:34 +08:00

1.3 KiB
Raw Blame History

order title
6
zh-CN en-US
位置 Position

zh-CN

有四个位置,tabPosition="left|right|top|bottom"

en-US

Tab's position: left, right, top or bottom.

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

const Demo = React.createClass({
  getInitialState() {
    return {
      tabPosition: 'top',
    };
  },
  changeTabPosition(tabPosition) {
    this.setState({ tabPosition });
  },
  render() {
    return (
      <div>
        <div style={{ marginBottom: 16 }}>
          页签位置
          <Select value={this.state.tabPosition} onChange={this.changeTabPosition}
            dropdownMatchSelectWidth={false}
          >
            <Option value="top">top</Option>
            <Option value="bottom">bottom</Option>
            <Option value="left">left</Option>
            <Option value="right">right</Option>
          </Select>
        </div>
        <Tabs tabPosition={this.state.tabPosition}>
          <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>
    );
  },
});

ReactDOM.render(<Demo />, mountNode);