1👍
Yes you can by firing an event. for example:
in your app.js
window.Fire = new Vue();
For example here you create a user then you want to update table after creating a new user, Follow these steps:
createUser(){
// FireUpdate is your fire name, you can give it any name you want!
// Call this after you post something to specific route.
Fire.$emit('FireUpadte');
}
Then you will load new users using this approach:
created(){
// Load new Users after created.
Fire.$on('FireUpadte', () => { this.createUser(); });
}
For more information check this video: https://www.youtube.com/watch?v=DHuTkJzH2jI&list=PLB4AdipoHpxaHDLIaMdtro1eXnQtl_UvE&index=20
- [Vuejs]-Firebase signInWithEmailAndPassword not working in vue.js
- [Vuejs]-Call to undefined method Person::id()
0👍
What you’re looking for are websockets
. You establish a websocket connection and it stays open, allowing the server to notify the web app when something changes.
You can run your own socket.io
server on a Node.js
backend or use a service like Pusher.com
(very cheap, free tier is pretty big).
I highly recommend going the Pusher.com
route, they also have great tutorials ; )
- [Vuejs]-How to calculate total from three components in Vuejs?
- [Vuejs]-Moxios not working properly when using window.axios
Source:stackexchange.com