I've already seen this answer which fits my question : In Vue JS, call a filter from a method inside the vue instance
Now with that out of the way, when doing
console.log(this.$options)
I get undefined so I can't call filters on it..
This is my code:
methods:{
style:(input)=>{
return {
backgroundColor:this.$options.filters.color(input),
}
}
},
filters: {
color: function (value) {
console.log(color(value));
if (!value) return ''
return `rgb(${value},${value},${value})`
}
}
Error in render: "TypeError: Cannot read property 'filters' of undefined"
style: function(input) {}