diff --git a/components/select/demo/coordinate.md b/components/select/demo/coordinate.md new file mode 100644 index 0000000000..a83588fb12 --- /dev/null +++ b/components/select/demo/coordinate.md @@ -0,0 +1,51 @@ +# 联动 + +- order: 6 + +省市联动是典型的例子。 + +--- + +````jsx +var Select = antd.Select; +var Option = Select.Option; + +var provinceData = ['浙江', '江苏']; +var cityData = { + '浙江': ['杭州', '宁波', '温州'], + '江苏': ['南京', '苏州', '镇江'] +}; + + +var App = React.createClass({ + getInitialState() { + return { + cities: cityData[provinceData[0]] + }; + }, + handleProvinceChange(value) { + this.setState({ + cities: cityData[value] + }); + }, + render() { + var provinceOptions = provinceData.map(function(province) { + return ; + }); + var cityOptions = this.state.cities.map(function(city) { + return ; + }); + return
+ +   + +
; + } +}); +React.render(, document.getElementById('components-select-demo-coordinate')); +```` + diff --git a/components/select/index.md b/components/select/index.md index 5456602134..d651f6305d 100644 --- a/components/select/index.md +++ b/components/select/index.md @@ -24,7 +24,8 @@ | 参数 | 说明 | 类型 | 默认值 | |----------|----------------|----------|--------------| -| value | 指定默认选中的条目 | string/Array | 无 | +| value | 指定选中的条目 | string/Array | 无 | +| defaultValue | 指定默认选中的条目 | string/Array | 无 | | multiple | 支持多选 | | false | | filterOption | 是否根据输入项进行筛选 | | true | | tags | 可以把随意输入的条目作为tag,输入项不需要与下拉选项匹配 | |false |