ElementUI的表單和vee-validate結合使用時發生衝突的解決

在Vue項目中使用ElementUI表單時,同時又引入了vee-validate進行使用的時候,在瀏覽器上會出現這樣的報錯:javascript

[Vue warn]: The computed property "fields" is already defined in data.java

這個的處理方式,就是在main.js文件中增長如下的配置:瀏覽器

const config = {
fieldsBagName: 'vee-fields'
}
Vue.use(VeeValidate, config)

  

這樣就能解決這個衝突的問題了。
相關文章
相關標籤/搜索