初始化input框中的内容,并进行初始化,出现

vue.esm.js?efeb:628 [Vue warn]: Error in v-on handler: "Error: [iView warn]: must call validateField

原因是因为验证的时候,实际值虽然初始化了但是实际上还没渲染到dom上,因此应该改使用nextTick,即等元素被初始化成功后才进行验证

                    this.params.frequence = '15';

                    this.$nextTick(()=>{

                        this.$refs.newTest.validateField('frequence')

                    })

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2021-04-07
  • 2022-12-23
  • 2021-06-29
  • 2021-11-11
  • 2022-12-23
猜你喜欢
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案