Currently, I am working on creating a computed property that checks if an item is in the array. The function I have created returns a boolean value and takes one parameter, which is the item to be checked.
isSelected: function (item: MediaGalleryItemTypes) {
return this.selectedItems.some(e => e._id === item._id)
}
When using the variable in the template section to pass it to another component, here is how I implement it:
DocumentCard(:is-selected="isSelected(document)")
Unfortunately, the code throws an error stating:
chunk-common.js:5918 Uncaught (in promise) TypeError: _ctx.isSelected is not a function
and in VSCode, the error message is:
This expression is not callable. Type 'Boolean' has no call signatures.
Any suggestions on how to resolve this issue and create a computed property with a parameter?