index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import control from '../components/control.vue'
  4. import videoList from '../components/videoList.vue'
  5. import channelList from '../components/channelList.vue'
  6. import login from '../components/Login.vue'
  7. import parentPlatformList from '../components/ParentPlatformList.vue'
  8. const originalPush = VueRouter.prototype.push
  9. VueRouter.prototype.push = function push(location) {
  10. return originalPush.call(this, location).catch(err => err)
  11. }
  12. Vue.use(VueRouter)
  13. export default new VueRouter({
  14. mode:'hash',
  15. routes: [
  16. {
  17. path: '/',
  18. component: control,
  19. },
  20. {
  21. path: '/videoList',
  22. component: videoList,
  23. },
  24. {
  25. path: '/login',
  26. name: '登录',
  27. component: login,
  28. },
  29. {
  30. path: '/channelList/:deviceId/:parentChannelId/:count/:page',
  31. name: 'channelList',
  32. component: channelList,
  33. },,
  34. {
  35. path: '/parentPlatformList/:count/:page',
  36. name: 'parentPlatformList',
  37. component: parentPlatformList,
  38. },
  39. ]
  40. })