<el-col :span="4">
<el-form-item>
<el-select
v-model="userListParams.strdeptname"
placeholder="请选择部门"
size="medium"
value-key="Strdeptcode"
@change="onSelectDept"
>
<el-option
v-for="(item, index) in deptList"
:key="index"
:label="item.Strdeptname"
:value="item"
></el-option>
</el-select>
</el-form-item>
</el-col>
value-key 不能掉,option 里的 value 绑定 item
change事件val 就是当前选中的所有内容, ( 根据自身需求来 处理选中的值 )
onSelectDept(val) {
const { Strdeptcode, Strdeptname } = val;
this.userListParams.strrolename = '';
this.userListParams.strdeptname = Strdeptname;
// this.getRoleListData(Strdeptcode);
// this.getUserList(this.userListParams);
},