Get router push parameters

Hi, I am trying to navigate a new page and get some parameters through router push, unfortunately, I got the below error, please advise,

import router from '../routes'
export default {
  data () {
    return {
  methods: {
      getParams () {
        var routerParams = router.params
        this.createdOn = routerParams.createdOn

I’m not exactly clear what’s in the file ../routes but it seems unlikely to be what you want. You seem to be using it as a way to get hold of the current route.

More likely you want to try this.$route (see, perhaps this.$route.params.createdOn?

Usually it’s better not to grab the route at all inside components and to let the router inject those parameters as props instead. See

Here is the router code, I triggered the router.push in vuex, and I didn’t register the router in the main.js

import Vue from 'vue'
import VueRouter from 'vue-router'
//import store from './Stores/account.module'
import Signin from './Login/Signin.vue'
import Home from './Home/Home.vue'
import Reg from './Register/Registration.vue'
import Mem from './Members/MemberDetails.vue'


const routes = [
        path: '/home',
        component: Home,
        beforeEnter (to, from, next) {
          const publicPages = ['/login', '/reg'];
          const authRequired = !publicPages.includes(to.path);
          const loggedIn = localStorage.getItem('userId');
          if (authRequired && !loggedIn) {
            return next('/login');

export default new VueRouter({mode: 'history', routes})

So your routes file is exporting the router instance. You can get the current route using router.currentRoute, see

You haven’t explained why you aren’t adding the router to your root Vue instance. That would be my preferred option so you can access the route using this.$route.