fix prefixCls

This commit is contained in:
yiminghe 2015-06-12 12:01:02 +08:00
parent 58938d38e7
commit 90241a7efe
16 changed files with 64 additions and 48 deletions

View File

@ -61,7 +61,7 @@ module.exports = function (props) {
document.body.appendChild(div);
}
React.render(<Dialog className="ant-confirm" renderToBody={false} visible={true} closable={false} title="" animation="zoom" maskAnimation="fade" width={width}>
React.render(<Dialog prefixCls="ant-modal" className="ant-confirm" renderToBody={false} visible={true} closable={false} title="" animation="zoom" maskAnimation="fade" width={width}>
<div style={{zoom: 1, overflow: 'hidden'}}>{body} {footer}</div>
</Dialog>, div, function () {

View File

@ -16,7 +16,7 @@
| 参数 | 说明 | 类型 | 默认值 |
|------------|----------------|------------------|--------------|
| title | 标题 | React.Element|String | 无 |
| title | 标题 | React.Element or String | 无 |
| onOk | 点击确定回调,参数为关闭函数 | function | 无 |
| onCancel | 取消回调,参数为关闭函数 | function | 无 |
| width | 宽度 | String or Number | 375 |

View File

@ -6,7 +6,8 @@ var Dropdown = require('rc-dropdown');
module.exports = React.createClass({
getDefaultProps: function() {
return {
animation: 'slide-up'
animation: 'slide-up',
prefixCls: 'ant-dropdown'
};
},
render: function() {

View File

@ -12,6 +12,7 @@ var Modal = React.createClass({
getDefaultProps() {
return {
prefixCls: 'ant-modal',
onOk: noop,
onCancel: noop,
onBeforeClose: noop

View File

@ -1,22 +0,0 @@
# 基本
- order: 0
基本用法。
---
````jsx
var Tab = antd.Tab;
var TabPanel = Tab.Panel;
function callback() {}
React.render(
<Tab defaultActiveKey="2" onChange={callback}>
<TabPanel tab="tab 1" key="1">选项卡一</TabPanel>
<TabPanel tab="tab 2" key="2">选项卡二</TabPanel>
<TabPanel tab="tab 3" key="3">选项卡三</TabPanel>
</Tab>
, document.getElementById('components-tab-demo-basic'));
````

View File

@ -1,4 +0,0 @@
var Tab = require('rc-tabs');
Tab.Panel = Tab.TabPane;
module.exports = Tab;

View File

@ -0,0 +1,22 @@
# 基本
- order: 0
基本用法。
---
````jsx
var Tabs = antd.Tabs;
var TabPane = Tabs.TabPane;
function callback() {}
React.render(
<Tabs defaultActiveKey="2" onChange={callback}>
<TabPane tab="tab 1" key="1">选项卡一</TabPane>
<TabPane tab="tab 2" key="2">选项卡二</TabPane>
<TabPane tab="tab 3" key="3">选项卡三</TabPane>
</Tabs>
, document.getElementById('components-tabs-demo-basic'));
````

18
components/tabs/index.jsx Normal file
View File

@ -0,0 +1,18 @@
'use strict';
var Tabs = require('rc-tabs');
var React = require('react');
class AntTabs extends React.Component {
render() {
return <Tabs {...this.props}/>;
}
}
AntTabs.defaultProps = {
prefixCls: 'ant-tabs'
};
AntTabs.TabPane = Tabs.TabPane;
module.exports = AntTabs;

View File

@ -1,4 +1,4 @@
# Tab
# Tabs
- category: Components
- chinese: 标签页
@ -9,7 +9,7 @@
## API
### Tab
### Tabs
| 参数 | 说明 | 类型 | 默认值 |
|------------------|----------------------------------------------|----------|------------|
@ -20,9 +20,9 @@
| onTabClick | tab 被点击的回调 | Function | 无 |
### Tab.Panel
### Tabs.TabPane
| 参数 | 说明 | 类型 | 默认值 |
|------|---------------------|--------|--------|
| key | 对应 activeKey | Object | 无 |
| tab | 选项卡头显示文字 | String | 无 |
| key | 对应 activeKey | String | 无 |
| tab | 选项卡头显示文字|React.Element or String | 无 |

View File

@ -3,7 +3,7 @@ require('./style/index.less');
var antd = {
Datepicker: require('./components/datepicker'),
Tooltip: require('./components/tooltip'),
Tab: require('./components/tab'),
Tabs: require('./components/tabs'),
Modal: require('./components/modal'),
Menu: require('rc-menu'),
Dropdown: require('./components/dropdown'),

View File

@ -1,17 +1,17 @@
@prefixConfirmCls: ant-confirm;
@confirmPrefixCls: ant-confirm;
.@{prefixConfirmCls} {
.@{confirmPrefixCls} {
.rc-dialog-header {
.ant-modal-header {
display: none;
}
.rc-dialog-body {
.ant-modal-body {
padding: 30px 40px;
}
.@{prefixConfirmCls}-body {
.@{prefixConfirmCls}-content {
.@{confirmPrefixCls}-body {
.@{confirmPrefixCls}-content {
margin-left: 33px;
font-size: 12px;
color: #999;
@ -28,7 +28,7 @@
}
}
.@{prefixConfirmCls}-btns {
.@{confirmPrefixCls}-btns {
margin-top: 30px;
float: right;

View File

@ -1,10 +1,10 @@
@prefixDialogCls: rc-dialog;
@dialogPrefixCls: ant-modal;
@import "./dialog/Dialog.less";
@import "./dialog/Mask.less";
.@{prefixDialogCls}-footer button + button {
.@{dialogPrefixCls}-footer button + button {
margin-left: 10px;
margin-bottom: 0;
}

View File

@ -1,4 +1,4 @@
.@{prefixDialogCls} {
.@{dialogPrefixCls} {
outline: none;
position: absolute;
left: -9999px;

View File

@ -1,4 +1,4 @@
.@{prefixDialogCls} {
.@{dialogPrefixCls} {
&-wrap-hidden > &-mask {
display: none;

View File

@ -1,4 +1,4 @@
@dropdownPrefixCls: rc-dropdown;
@dropdownPrefixCls: ant-dropdown;
.@{dropdownPrefixCls} {
position: absolute;

View File

@ -1,4 +1,4 @@
@prefixClass: rc-tabs;
@prefixClass: ant-tabs;
@easing-in-out: cubic-bezier(0.35, 0, 0.25, 1);