I am facing an issue with a method that needs to run on route load. Despite attempting to call it from the updated
hook, it is not functioning as expected. Additionally, I have encountered an ESLint error.
methods: {
getDeals (key, cb) {
this.dealsRel.child(key).on('child_added', snap => {
let dealRef = this.dealsRef.child(snap.key)
dealRef.once('value', cb)
})
}
},
updated: {
getDeals (this.finalItem, snap => {
var snapVal = snap.val()
this.deals.push(snapVal)
console.log(this.deals)
})
}
The following ESLint error persists:
Parsing error: Unexpected token
31 | },
32 | updated: {
33 | getDeals (this.finalItem, snap => {
| ^
34 | var snapVal = snap.val()
35 | this.deals.push(snapVal)
It seems like there might be an issue with my formatting. I need to find the correct way to make this work.