mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-27 13:46:18 +10:00
Merge branch 'master' into develop-0.11.0
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# 月选择器
|
||||
|
||||
- order: 9
|
||||
|
||||
使用 MonthPicker 实现月选择器.
|
||||
|
||||
---
|
||||
|
||||
````jsx
|
||||
import { Datepicker } from 'antd';
|
||||
const MonthPicker = Datepicker.MonthPicker;
|
||||
ReactDOM.render(
|
||||
<MonthPicker defaultValue="2015-12" />
|
||||
, document.getElementById('components-datepicker-demo-month-picker'));
|
||||
````
|
||||
@@ -8,11 +8,11 @@ import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
|
||||
import DateTimeFormat from 'gregorian-calendar-format';
|
||||
import objectAssign from 'object-assign';
|
||||
|
||||
function createPicker(TheCalendar) {
|
||||
function createPicker(TheCalendar, defaultFormat) {
|
||||
return React.createClass({
|
||||
getDefaultProps() {
|
||||
return {
|
||||
format: 'yyyy-MM-dd',
|
||||
format: defaultFormat || 'yyyy-MM-dd',
|
||||
transitionName: 'slide-up',
|
||||
popupStyle: {},
|
||||
onSelect: null, // 向前兼容
|
||||
@@ -154,7 +154,7 @@ function createPicker(TheCalendar) {
|
||||
}
|
||||
|
||||
const AntDatePicker = createPicker(Calendar);
|
||||
const AntMonthPicker = createPicker(MonthCalendar);
|
||||
const AntMonthPicker = createPicker(MonthCalendar, 'yyyy-MM');
|
||||
|
||||
const AntCalendar = React.createClass({
|
||||
getDefaultProps() {
|
||||
|
||||
+23
-8
@@ -1,10 +1,25 @@
|
||||
window.require = function(path) {
|
||||
if (path in window) {
|
||||
return window[path];
|
||||
} else {
|
||||
throw 'There should not have modules here: ' + path;
|
||||
}
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
window.require = function (path) {
|
||||
var result = window;
|
||||
var namespaces = path.split('/');
|
||||
namespaces.forEach(function (key, i) {
|
||||
if (i === 2) {
|
||||
key = capitalizeFirstLetter(key);
|
||||
}
|
||||
if (key !== 'lib') {
|
||||
if (result[key]) {
|
||||
result = result[key];
|
||||
} else {
|
||||
throw 'There should not have modules here: ' + path;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
window['css-animation'] = require('css-animation');
|
||||
window['react-router'] = require('react-router');
|
||||
window.Clip = require('./clip');
|
||||
@@ -101,7 +116,7 @@ InstantClickChangeFns.push(function () {
|
||||
ReactDOM.render(
|
||||
<Select defaultValue={antdVersion.latest} size="small" style={{width:130}}
|
||||
onChange={onChange}>{options}</Select>
|
||||
, document.getElementById('versions-select'));
|
||||
, document.getElementById('versions-select'));
|
||||
});
|
||||
|
||||
window.BrowserDemo = React.createClass({
|
||||
@@ -114,7 +129,7 @@ window.BrowserDemo = React.createClass({
|
||||
<div className="control minify"></div>
|
||||
<div className="control expand"></div>
|
||||
</div>
|
||||
<input className="address-bar" defaultValue="http://www.example.com" />
|
||||
<input className="address-bar" defaultValue="http://www.example.com"/>
|
||||
</header>
|
||||
<section className="window-content">
|
||||
{this.props.children}
|
||||
|
||||
@@ -245,6 +245,7 @@
|
||||
}
|
||||
&.clear {
|
||||
float: right;
|
||||
margin-right: -32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user