0👍
✅
Please take another look at the Vue documentation: https://v2.vuejs.org/v2/guide/components.html
Maybe you’re not sharing all your code, but the structure is way off.
Your methods
function (which should be an object) is inside your data
object.
Besides that you’re missing parentheses .
Start with a valid structure and syntax:
const app = new Vue({
el: "#app",
data: {
thisFood: [], //food array
newFood: {
name: "",
price: "",
cuisine: "",
},
filterFood: ["null", "pizza", "chips", "rice", "chocolate", "salad"]
},
methods: {
chooseFilter(filter) {
//
}
},
});
Source:stackexchange.com