提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
734 B

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
  1. import {createRouter,createWebHistory} from 'vue-router'
  2. import Home from '@/components/Home.vue'
  3. import News from '@/components/News.vue'
  4. import About from '@/components/About.vue'
  5. import Detail from '@/components/Detail.vue'
  6. const router = createRouter({
  7. history:createWebHistory(),
  8. routes:[
  9. {
  10. name:'zhuye',
  11. path:'/home',
  12. component:Home
  13. },
  14. {
  15. name:'xinwen',
  16. path:'/news',
  17. component:News,
  18. children:[
  19. {
  20. name:'xiangqing',
  21. path:'detail/:id/:title/:content',
  22. component:Detail,
  23. props(route){
  24. return route.query
  25. }
  26. }
  27. ]
  28. },
  29. {
  30. name:'guanyu',
  31. path:'/about',
  32. component:About
  33. },
  34. {
  35. path:'/',
  36. redirect:'/home'
  37. }
  38. ]
  39. })
  40. export default router