vue的element 选择框问题?
form表单里面现在是多选,传给后台的值是数组,但是去掉multiple="true"的时候单选时变为了字符串,因为跟后台约定的是穿到数组里,单选的时候前端这应该怎么改下
<el-select                v-model="formData.servicePointId"
                size="normal"
                clearable="true"
                filterable
                multiple="true"
                placeholder="全部"
              >
                <el-option
                  v-for="item in servicePointList"
                  :key="item.servicePointId"
                  :label="item.servicePointName"
                  :value="item.servicePointId"
                ></el-option>
              </el-select>
回答:
抛开其他 ele的API 有个 multiple-limit 是否能满足你?
回答:
直接绑定数据的第一个元素即可。但是你初始化的时候得是['']不能是空数组[]
v-model="formData.servicePointId[0]"以上是 vue的element 选择框问题? 的全部内容, 来源链接: utcz.com/p/933175.html
