Browse Source

添加更多 Demo

pull/20/head
Yuwei Ba 10 years ago
parent
commit
3a4817b236
  1. 22
      components/tabs/demo/disabled.md
  2. 25
      components/tabs/demo/slide.md
  3. 6
      style/components/tab.less

22
components/tabs/demo/disabled.md

@ -0,0 +1,22 @@
# 带有禁用
- order: 2
禁用某一项
---
````jsx
var Tab = antd.Tab;
var TabPane = Tab.TabPane;
function callback() {}
React.render(
<Tab defaultActiveKey="1" onChange={callback}>
<TabPane tab="tab 1" key="1">选项卡一</TabPane>
<TabPane tab="tab 2" disabled={true} key="2">选项卡二</TabPane>
<TabPane tab="tab 3" key="3">选项卡三</TabPane>
</Tab>
, document.getElementById('components-tabs-demo-disabled'));
````

25
components/tabs/demo/slide.md

@ -0,0 +1,25 @@
# 滑动
- order: 2
可以滑动
---
````jsx
var Tab = antd.Tab;
var TabPane = Tab.TabPane;
function callback() {}
React.render(
<Tab defaultActiveKey="1" onChange={callback}>
<TabPane tab="tab 1" key="1">选项卡一</TabPane>
<TabPane tab="tab 2" key="2">选项卡二</TabPane>
<TabPane tab="tab 3" key="3">选项卡三</TabPane>
<TabPane tab="tab 4" key="4">选项卡四</TabPane>
<TabPane tab="tab 5" key="5">选项卡五</TabPane>
<TabPane tab="tab 6" key="6">选项卡六</TabPane>
</Tab>
, document.getElementById('components-tabs-demo-slide'));
````

6
style/components/tab.less

@ -136,7 +136,10 @@
div.@{prefixClass}-tab-disabled {
pointer-events: none;
cursor: default;
color: #ccc;
a {
color: #ccc;
}
}
.@{prefixClass}-tab {
@ -153,6 +156,7 @@
margin-bottom: 4px;
font-weight: 500;
display: inline-block;
color: #666;
}
> a:hover {

Loading…
Cancel
Save