I came across a very strange behavior where Vue is complaining about a missing ) but in reality there is no missing ). What makes it even stranger is that if I do not use the filterOptions object but make a simple property then it works. For some reason it can't handle it being a property of an object.
[Vue warn]: Failed to generate render function: SyntaxError: missing ) after argument list
<input
v-model="date_format(filterOptions.date_start)"
/>
But if I change it to this (without filterOptions object) then it works
<input
v-model="date_format(startdate)"
/>
Here's my date_format function and data.
methods:
{
date_format(date)
{
return (date != null && date != '') ?
moment(date, 'YYYY-MM-DD').format("DD.MM.YYYY") : ''
},
},
data()
{
return {
total: 10,
startdate: '',
filterOptions: {
perPage: 10,
orderBy: 'end_date',
orderDirection: 'desc',
date_start: '',
end_date_end: '',
},
}
},