1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/open-hand-choerodon-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
flex.md 1.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
huihuawk Отправлено 3 лет назад 5f222dd
order title
11
zh-CN en-US
柔性布局
Flex Layout

zh-CN

当为整个Tabs设置固定高度或者使用flex=1撑满整个外部容器时,内部标签头部能固定而内容柔性并出现滚动条。

en-US

When setting a fixed height for the entire Tabs or using flex=1 to fill the entire outer container, the header of the inner label can be fixed but the content is flexible and scroll bars appear.

import { Tabs, Select } from 'choerodon-ui';

const TabPane = Tabs.TabPane;
const Option = Select.Option;

function callback(key) {
  console.log(key);
}

const App = () => {
  const [mode, setMode] = React.useState('top');

  return (
    <div>
      <div style={{ marginBottom: 16 }}>
        Tab position:
        <Select
          value={mode}
          onChange={setMode}
          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 defaultActiveKey="1" onChange={callback} flex tabPosition={mode} style={{ height: 300 }}>
        <TabPane tab="Tab 1" key="1">
          <div style={{ height: 400 }}>
            Content of Tab Pane 1
          </div>
        </TabPane>
        <TabPane tab="Tab 2" key="2">
          Content of Tab Pane 2
        </TabPane>
        <TabPane tab="Tab 3" key="3">
          Content of Tab Pane 3
        </TabPane>
      </Tabs>
    </div>
  )
}

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

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/open-hand-choerodon-ui.git
git@gitlife.ru:oschina-mirror/open-hand-choerodon-ui.git
oschina-mirror
open-hand-choerodon-ui
open-hand-choerodon-ui
master