how to access router from the store vue

  1. Import the Vue instance in your store module:
import Vue from 'vue';
  1. Access the router instance from the Vue instance:
const router = Vue.prototype.$router;
  1. Use the router instance in your Vuex store module as needed. For example, you can navigate to a different route:
router.push('/new-route');