3👍
You can use a router middleware to prevent the client to navigate elsewhere.
router.beforeEach(function(to, from, next) {
if (isLocked) {
alert('Navigation is locked');
next(false);
} else {
next();
}
});
Here is an example where the waiter can lock the page after selecting the bill. Although it can be automatically set in mounted. You can adjust the code to your own needs.
- [Vuejs]-Vue.js, vuex with Firebase cloud firestore, updating the front end after adding or removing any record from the database
- [Vuejs]-How to compile/build other JS files into main.js on Electron/Vue
Source:stackexchange.com