vee-validate3.0踩坑

本文为踩坑记录:

近日,项目欲把vee-validate2.0版本升级到v--validate3.0版本 

在实操情况下,遇到如下报错(具体如图)

Property or method "errors" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

vee-validate3.0踩坑

出现上述错误的原因是项目vue的版本过低(低于2.6.0)从[email protected]开始,Vue为具名和范围插槽引入了一个全新的语法:v-slot指令,统一了slot和slot-scope语法。

解决方案:

1、升级vue的版本

2、不使用vee-validate  v-slot的指令