0👍
For saving data in firebase database, you have usually two options.
1) cloud Firestore (currently in beta version)
2) Real time database
As cloud Firestore is in beta, i would suggest to go with real time database if your app will be in production soon.
so for storing it in firebase using real time database, you first need to create reference of firebase database like below
const databaseRef = firebase.database();
After that use this reference to set data like below
databaseRef.ref('fruitDetails/').set({
fruitName: 'name of the fruit from text field',
count: 'count from count text field'
});
Make sure to use the same reference of database in your whole app, if you don’t want to create multiple databases.
- [Vuejs]-Refs a slot to define the parent function
- [Vuejs]-Return validation errors from laravel controller to vue
Source:stackexchange.com