File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 217217
218218 let prop = getPropByPath (model, path, true );
219219
220+ this .validateDisabled = true ;
220221 if (Array .isArray (value)) {
221- this .validateDisabled = true ;
222222 prop .o [prop .k ] = [].concat (this .initialValue );
223223 } else {
224- this .validateDisabled = true ;
225224 prop .o [prop .k ] = this .initialValue ;
226225 }
226+ /* Select 的值被代码改变时不会触发校验,
227+ 这里需要强行触发一次,刷新 validateDisabled 的值,
228+ 确保 Select 下一次值改变时能正确触发校验 */
229+ this .broadcast (' ElSelect' , ' fieldReset' );
227230 },
228231 getRules () {
229232 let formRules = this .form .rules ;
Original file line number Diff line number Diff line change 789789
790790 this .$on (' handleOptionClick' , this .handleOptionSelect );
791791 this .$on (' setSelected' , this .setSelected );
792+ this .$on (' fieldReset' , () => {
793+ this .dispatch (' ElFormItem' , ' el.form.change' );
794+ });
792795 },
793796
794797 mounted () {
You can’t perform that action at this time.
0 commit comments