afc163
10 years ago
9 changed files with 117 additions and 2 deletions
@ -0,0 +1,13 @@ |
|||
# 基本 |
|||
|
|||
- description: 最简单的用法 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
var Datepicker = antd.datepicker; |
|||
|
|||
React.render( |
|||
<Datepicker /> |
|||
, document.getElementById('components-datepicker-demo-basic')); |
|||
```` |
@ -0,0 +1,34 @@ |
|||
require('rc-calendar/assets/index.css'); |
|||
var React = require('react'); |
|||
var Calendar = require('rc-calendar'); |
|||
var DatePicker = Calendar.Picker; |
|||
var GregorianCalendar = require('gregorian-calendar'); |
|||
var zhCn = require('gregorian-calendar/lib/locale/zh-cn'); |
|||
|
|||
module.exports = React.createClass({ |
|||
getInitialState: function () { |
|||
var value = new GregorianCalendar(zhCn); |
|||
value.setTime(Date.now()); |
|||
return { |
|||
time: Date.now(), |
|||
showTime: true, |
|||
value: value |
|||
}; |
|||
}, |
|||
render: function () { |
|||
var state = this.state; |
|||
var calendar = ( |
|||
<Calendar |
|||
orient={['top', 'left']} |
|||
showTime={this.state.showTime} showClear={true} /> |
|||
); |
|||
return ( |
|||
<DatePicker |
|||
trigger={<span className="datepicker-icon" />} |
|||
formatter={this.props.formatter} calendar={calendar} |
|||
value={this.state.value} onChange={this.handleChange}> |
|||
<input type="text" className="datepicker-input" /> |
|||
</DatePicker> |
|||
); |
|||
} |
|||
}); |
@ -0,0 +1,20 @@ |
|||
# Datepicker 日期选择框 |
|||
|
|||
- category: Component |
|||
|
|||
--- |
|||
|
|||
选择日期。 |
|||
|
|||
## 什么时候使用 |
|||
|
|||
的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束。 |
|||
|
|||
的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束,的凯撒垃圾分类快结束。 |
|||
|
|||
|
|||
## 为什么使用 |
|||
|
|||
的凯撒垃圾分类的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束。 |
|||
|
|||
的凯撒垃圾分类快结束的凯撒垃圾分类快结束的凯撒垃圾分类快结束,的凯撒垃圾分类快结束。 |
@ -0,0 +1,3 @@ |
|||
window.antd = { |
|||
datepicker: require('./components/datepicker') |
|||
}; |
@ -0,0 +1,27 @@ |
|||
var webpack = require('webpack'); |
|||
|
|||
module.exports = { |
|||
entry: './index.js', |
|||
|
|||
resolve: { |
|||
extensions: ['', '.js', '.jsx'], |
|||
}, |
|||
|
|||
output: { |
|||
path: 'dist', |
|||
filename: 'index.js' |
|||
}, |
|||
|
|||
externals: { |
|||
react: "React" |
|||
}, |
|||
|
|||
module: { |
|||
loaders: [ |
|||
{test: /\.jsx$/, loader: 'jsx-loader?harmony'}, |
|||
{test: /\.js$/, loader: 'jsx-loader?harmony'}, |
|||
{test: /\.json$/, loader: 'json-loader'}, |
|||
{test: /\.css/, loader: 'style!css'} |
|||
] |
|||
}, |
|||
}; |
Loading…
Reference in new issue