You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
![]()
2 weeks ago
|
# BaseSelect - 下拉选
|
||
|
|
||
|
配置项参考 [el-select](https://element-plus.gitee.io/zh-CN/component/select.html "https://element-plus.gitee.io/zh-CN/component/select.html")
|
||
|
<br/>
|
||
|
BaseSelect/BaseTree 选项赋值,参考 util.js -> [setOptions](./../method/setOptions.md)
|
||
|
|
||
|
```javascript
|
||
|
//动态选项配置示例:
|
||
|
{
|
||
|
tag: 'BaseSelect',
|
||
|
label: '申请人:',
|
||
|
key: 'user',
|
||
|
value: '',
|
||
|
default: '',
|
||
|
attribute: {//配置项内容
|
||
|
placeholder: '请选择申请人',
|
||
|
fetchOptions: {
|
||
|
baseURL: '', //axios.request请求的基础路径
|
||
|
url: `/system/user/list`,
|
||
|
method: "get",
|
||
|
data: {
|
||
|
page: 1,
|
||
|
limit: 999,
|
||
|
},
|
||
|
dataType: "json",
|
||
|
dataPath: "data.list",//可不指定,默认值-data.list,返回值中的数据路径
|
||
|
labelKey: "nickName",//可不指定,默认值-name,返回值中的字段名
|
||
|
valueKey: "userId",//可不指定,默认值-id,返回值中的字段名
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
//静态选项配置示例:
|
||
|
{
|
||
|
tag: 'BaseSelect',
|
||
|
label: '部门:',
|
||
|
key: 'deptId',
|
||
|
value: '',
|
||
|
default: '',
|
||
|
attribute: {//配置项内容
|
||
|
placeholder: '请选择公司',
|
||
|
options: [
|
||
|
{
|
||
|
label: '产品部',
|
||
|
value: 1
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|