3👍
✅
Be sure to check the Vue docs about computed properties.
You should not call them as functions, but as properties (since they are computed properties).
You can try to console log filteredRecords
in the beforeMount
hook like this:
beforeMount() {
console.log(this.filteredRecords)
},
0👍
This seems like a fundamental misunderstanding on how Computed properties work. Computed properties are accessed the same way you would access props or data on a component. They are consumed as values, not as methods. A big hint to this fact is that you’re calling map**Getters**
You could consume filteredRecords
in your template something like:
<div v-for="record of filteredRecords" :key="record.someKey">...</div>
or by assigning it to a data property
this.records = this.filteredRecords
Source:stackexchange.com