VueJS - How to update component data from a function inside a method?
问题 I'm trying to do a search using Firebase. I have this in my VueJS Code. export default { data () { return { listings: [], searchData: { keyword: "" } } }, name: 'SearchScreen', components: { ValidationProvider, ValidationObserver }, firebase: { listings: listingsRef }, methods: { search () { console.log(this.searchData.keyword) listingsRef.orderByChild('location').equalTo(this.searchData.keyword).on('value', function (snapshot){ console.log(snapshot.val()) return{ listings: snapshot.val() } }