import Vue from 'vue'
import VueRouter from 'vue-router'
import pc from '../views/pc.vue'
import mobile from '../views/mobile.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    component: pc

  },
  {
    path: '/pcIndex',
    name: 'pcIndex',
    component: pc

  },
  {
    path: '/mobileIndex',
    name: 'mobileIndex',
    component: mobile

  },
]
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err);
};
const router = new VueRouter({
  // mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router