Seeking guidance on how to implement null testing in my filter. The current setup works well unless any of the fields contain a "null" value. In such cases, an error is thrown:
TypeError: Cannot read property 'includes' of null
Thank you in advance for any assistance provided!
computed: {
items () {
return this.keyword
? this.records.filter(item =>
item.name.includes(this.keyword) ||
item.location.includes(this.keyword) ||
item.status.includes(this.keyword) ||
item.vendor.includes(this.keyword) ||
item.model.includes(this.keyword) ||
item.serial.includes(this.keyword) ||
item.product_number.includes(this.keyword)
)
: this.records
},
}