Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

In Component ArrayField if set function for itemText thorw Error #26

Open
pamkil opened this issue Jul 8, 2021 · 0 comments · May be fixed by #27
Open

In Component ArrayField if set function for itemText thorw Error #26

pamkil opened this issue Jul 8, 2021 · 0 comments · May be fixed by #27

Comments

@pamkil
Copy link

pamkil commented Jul 8, 2021

Describe the bug
fields = [
...,
{
source: "fieldName",
type: "array",
attributes: {
chip: true,
select: false,
color: "yellow",
small: true,
column: true,
itemText: (value) => value.name,
},
},
...
];

Error
TypeError: this.item is not a function
at VueComponent.getItemText (ArrayField.vue?6144:55)
at _vm._t.value (ArrayField.vue?5725:26)
at Proxy.renderSlot (vue.runtime.esm.js?2b0e:2702)
at eval (ArrayField.vue?5725:13)
at Proxy.renderList (vue.runtime.esm.js?2b0e:2646)
at Proxy.render (ArrayField.vue?5725:8)
at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3569)
at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4081)
at Watcher.get (vue.runtime.esm.js?2b0e:4495)
at Watcher.run (vue.runtime.esm.js?2b0e:4570)

Additional context
vuetify-admin/blob/master/packages/admin/src/components/ui/fields/ArrayField.vue on line 55
Need to write this:
return this.itemText(item);

@pamkil pamkil linked a pull request Jul 8, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant