打开dialog后直接弹出错误,反复试过之后发现只有选择框添加了多选才会有这个问题
大家有遇到这个问题,有没有大佬说下解决方法
代码
<el-dialog v-model="dialogVisible" title="添加成员" width="500px">
<el-form
ref="formRef"
:rules="rules"
:validate-on-rule-change="false"
:model="form"
label-width="80px"
@submit.prevent
>
<el-form-item label="成员角色" required prop="role">
<el-select
v-model="form.role"
multiple
collapse-tags
collapse-tags-tooltip
placeholder="请选择成员角色"
style="width: 100%"
>
<el-option v-for="item in roleList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="微信号" required prop="username">
<el-input v-model="form.username" placeholder="请输入微信号" />
</el-form-item>
<el-form-item label="微信昵称" required prop="nickname">
<el-input v-model="form.nickname" placeholder="请输入微信昵称" />
</el-form-item>
<el-form-item label="商户列表" required prop="mer_id">
<el-select v-model="form.mer_id" placeholder="选择商户" style="width: 100%">
<el-option v-for="item in merList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="备注" required prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm(formRef)">确 定</el-button>
</span>
</template>
</el-dialog>
代码截图
效果