多选下拉框数据绑定问题~
```html
<el-form-item label="供应商类型" prop="suppilerTypeList" required>
<el-select
clearable
multiple
v-model="ruleForm.suppilerTypeList"
placeholder="请选择供应商"
style="width: 366px; height: 32px"
>
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
```html
data(){
return{
ruleForm: {
suppilerName: "",
remark: "",
suppilerTypeList: [],
suppilerWalletList: [],
},
}
```javascript
async add() {
this.ruleForm.suppilerWalletList = this.tableData;
this.ruleForm.suppilerTypeList = this.suppilerType;
// return
if (this.ruleForm.suppilerName == "") {
this.$message({
message: "供应商名称不能为空",
type: "error",
});
return;
} else if (this.ruleForm.suppilerTypeList == "") {
this.$message({
message: "供应商类型不能为空",
type: "error",
});
return;
}
let params = {
suppilerName: this.ruleForm.suppilerName,
remark: this.ruleForm.remark,
suppilerTypeList: this.ruleForm.suppilerTypeList,
suppilerWalletList: this.ruleForm.suppilerWalletList,
};
let res = await saveOrEdit(params);
console.log(res);
```
为什么拿不到呢ヽ(ー_ー)ノ
接口拿到 值后 ,赋值呗 。拿不到 你需要 看看 是不是真的返回来了