diff --git a/components/select/demo/options.md b/components/select/demo/options.md
new file mode 100644
index 0000000000..fdfc4dc95b
--- /dev/null
+++ b/components/select/demo/options.md
@@ -0,0 +1,47 @@
+
+
+#### 从数据直接生成
+使用 `options` 把 JSON 数据直接生成选择列表。
+
+
+
+#### Generate form options
+The select list can be populated using `options` property. This is a quick and easy way to provide the select content.
+
+
+```html
+
+
+
+
+```
+
diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md
index 86a856325f..55cc8a2128 100644
--- a/components/select/index.en-US.md
+++ b/components/select/index.en-US.md
@@ -35,7 +35,7 @@
| size | Size of Select input. `default` `large` `small` | string | default |
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | |
| value(v-model) | Current selected option. | string\|number\|string\[]\|number\[] | - |
-
+| options | Data of the selectOption, manual construction work is no longer needed if this property has been set | array<{value, label, [disabled, key, title]}> | \[] |
### events
| Events Name | Description | Arguments |
diff --git a/components/select/index.jsx b/components/select/index.jsx
index 7b8563293c..d50aadfb43 100644
--- a/components/select/index.jsx
+++ b/components/select/index.jsx
@@ -64,6 +64,7 @@ const SelectProps = {
getPopupContainer: PropTypes.func,
tokenSeparators: PropTypes.arrayOf(PropTypes.string),
getInputElement: PropTypes.func,
+ options: PropTypes.array,
}
const SelectPropTypes = {
@@ -121,6 +122,7 @@ export default {
prefixCls,
size,
mode,
+ options,
...restProps
} = getOptionProps(this)
const cls = {
@@ -157,7 +159,14 @@ export default {
return (
- {filterEmpty(this.$slots.default)}
+ {
+ options
+ ? options.map((option) => {
+ const { key, label = option.title, ...restOption } = option
+ return
+ })
+ : filterEmpty(this.$slots.default)
+ }
)
},
diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md
index be7dd2a5dd..400eaab641 100644
--- a/components/select/index.zh-CN.md
+++ b/components/select/index.zh-CN.md
@@ -34,6 +34,7 @@
| size | 选择框大小,可选 `large` `small` | string | default |
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string\[] | |
| value(v-model) | 指定当前选中的条目 | string\|string\[]\|number\|number\[] | - |
+| options | options 数据,如果设置则不需要手动构造 selectOption 节点 | array<{value, label, [disabled, key, title]}> | \[] |
> 注意,如果发现下拉菜单跟随页面滚动,或者需要在其他弹层中触发 Select,请尝试使用 `getPopupContainer={triggerNode => triggerNode.parentNode}` 将下拉弹层渲染节点固定在触发器的父元素中。