赞
踩
需求:当用户选择select的时候change事件需求获取到当前的整个值
:value的时候把整个item都传进去,用value-key接收就会传给change事件
- <el-select v-model="ruleForm.userName" :loading="commissionerListLoading" value-key="item" class="control" placeholder="请选择" @change="handleCommissioer">
- <el-option v-for="(item,idx) of commissionerList" :key="idx" :label="item.userName" :value="item"/>
- </el-select>
但是会发现当赋值的时候数据有变但是视图不变;可以用change中修改
- // 选择专员姓名
- handleCommissioer(val) {
- console.log(val)
-
- this.ruleForm.userName = val.userName
- this.ruleForm.userCode = val.userCode
- this.getLifeInsurance(val.userCode)
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。