mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
fix prefixCls
This commit is contained in:
parent
58938d38e7
commit
90241a7efe
@ -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 () {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------------|----------------|------------------|--------------|
|
||||
| title | 标题 | React.Element|String | 无 |
|
||||
| title | 标题 | React.Element or String | 无 |
|
||||
| onOk | 点击确定回调,参数为关闭函数 | function | 无 |
|
||||
| onCancel | 取消回调,参数为关闭函数 | function | 无 |
|
||||
| width | 宽度 | String or Number | 375 |
|
||||
|
@ -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() {
|
||||
|
@ -12,6 +12,7 @@ var Modal = React.createClass({
|
||||
|
||||
getDefaultProps() {
|
||||
return {
|
||||
prefixCls: 'ant-modal',
|
||||
onOk: noop,
|
||||
onCancel: noop,
|
||||
onBeforeClose: noop
|
||||
|
@ -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'));
|
||||
````
|
@ -1,4 +0,0 @@
|
||||
var Tab = require('rc-tabs');
|
||||
Tab.Panel = Tab.TabPane;
|
||||
|
||||
module.exports = Tab;
|
22
components/tabs/demo/basic.md
Normal file
22
components/tabs/demo/basic.md
Normal 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
18
components/tabs/index.jsx
Normal 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;
|
@ -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 | 无 |
|
2
index.js
2
index.js
@ -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'),
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
.@{prefixDialogCls} {
|
||||
.@{dialogPrefixCls} {
|
||||
outline: none;
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
|
@ -1,4 +1,4 @@
|
||||
.@{prefixDialogCls} {
|
||||
.@{dialogPrefixCls} {
|
||||
|
||||
&-wrap-hidden > &-mask {
|
||||
display: none;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@dropdownPrefixCls: rc-dropdown;
|
||||
@dropdownPrefixCls: ant-dropdown;
|
||||
|
||||
.@{dropdownPrefixCls} {
|
||||
position: absolute;
|
||||
|
@ -1,4 +1,4 @@
|
||||
@prefixClass: rc-tabs;
|
||||
@prefixClass: ant-tabs;
|
||||
|
||||
@easing-in-out: cubic-bezier(0.35, 0, 0.25, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user