2018-02-25 08:48:19 +00:00
|
|
|
<cn>
|
|
|
|
#### 分组
|
|
|
|
用 `OptGroup` 进行选项分组。
|
|
|
|
</cn>
|
|
|
|
|
|
|
|
<us>
|
|
|
|
#### Option Group
|
|
|
|
Using `OptGroup` to group the options.
|
|
|
|
</us>
|
|
|
|
|
2019-10-09 10:32:23 +00:00
|
|
|
```tpl
|
2018-02-25 08:48:19 +00:00
|
|
|
<template>
|
|
|
|
<a-select defaultValue="lucy" style="width: 200px" @change="handleChange">
|
|
|
|
<a-select-opt-group>
|
2019-09-28 12:45:07 +00:00
|
|
|
<span slot="label"><a-icon type="user" />Manager</span>
|
2018-02-25 08:48:19 +00:00
|
|
|
<a-select-option value="jack">Jack</a-select-option>
|
|
|
|
<a-select-option value="lucy">Lucy</a-select-option>
|
|
|
|
</a-select-opt-group>
|
|
|
|
<a-select-opt-group label="Engineer">
|
|
|
|
<a-select-option value="Yiminghe">yiminghe</a-select-option>
|
|
|
|
</a-select-opt-group>
|
|
|
|
</a-select>
|
|
|
|
</template>
|
|
|
|
<script>
|
2019-09-28 12:45:07 +00:00
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
handleChange(value) {
|
|
|
|
console.log(`selected ${value}`);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-02-25 08:48:19 +00:00
|
|
|
</script>
|
|
|
|
```
|