title: How to use $router.push in Vue-router?
body: <p>i need to use <code>$router.push</code> in Vue-router. Check my code:</p>
  
  <pre><code>axios.interceptors.response.use(function (response) {
      return response
    }, function (error) {
      if(error &amp;&amp; error.message === 'Network Error'){
          //here is problem. I can;t use this.$router in js file? How to fix this?
          this.$router.push('calendar')
      }
      return Promise.reject(error)
    })
  </code></pre>
  
  <p>My question is how do I use <code>$router.push</code> in this file?  Check my router:</p>
  
  <pre><code>import Vue from 'vue'
  import VueRouter from 'vue-router'
  import Home from '../views/Home.vue'
  import axios from 'axios'
  Vue.use(VueRouter);
  
  axios.interceptors.response.use(function(response) {
    return response
  }, function(error) {
    if (error &amp;&amp; error.message === 'Network Error') {
      Vue.push('home')
    }
    return Promise.reject(error)
  })
  
  const routes = [{
    path: '/',
    name: 'home',
    component: Home
  }, {
    other routes
  }]
  </code></pre>