I kept receiving this two warns and I dont know what is wrong.
[Vue warn]: The computed property "fields" is already defined in data.
```
md5-804260e7b8197a11fe90d09468e2fee2
MyComponent.js
export default {
name: 'form-template-list',
data () {
return {
fields: [
{
title: 'T铆tulo',
name: 'title',
sortField: 'title'
},
{
title: 'Descri莽茫o',
name: 'description',
sortField: 'description'
},
{
title: 'Vers茫o',
name: 'version',
sortField: 'version'
},
{
title: 'Criado Em',
name: 'createdAt',
sortField: 'created_at',
callback: 'formatDate|DD/MM/YYYY [脿s] hh:mm:ss'
},
{
title: 'Respostas',
name: 'formAnswers',
sortField: 'formAnswers',
callback: 'countItems'
},
{
title: 'A莽玫es',
name: '__slot:actions',
dataClass: 'center aligned'
}
],
sortOrder: [
{
field: 'title',
sortField: 'title',
direction: 'asc'
}
]
};
},
methods: {
onAction (action, data, index) {
console.log('slot action: ', action);
console.log('slot data: ', data);
console.log('slot index: ', index);
}
}
};
Any clue why is this happening?
have you got any mixin's loaded on the component?
The warnings are somewhat ambiguous but to me it suggests that you have a 'fields' defined in two places on the same property somewhere. might not even be related to this piece of code.
The biggest culprit i can think of is if you have a mixin loaded somewhere that has field defined in the data, and then defined again in the component itself.
@arthurvasconcelos If you're using vee-validate, see this issue.
Oh now that's make sense ... thanks for the clarification @ratiw.
Most helpful comment
@arthurvasconcelos If you're using vee-validate, see this issue.