Vux使用笔记-页面跳转的参数传递

可以使用path 和 name 来进行页面的跳转
this.$router.push({ path: '/inspection/inspectionRegister' , query: { item }})
this.$router.push({ name: 'inspectionRegister' , params: { item }})

 

其中需要注意的是:

当使用query 传递的时候 path 使用的是在router 文件中定义的 地址

import InspectionRegisterList from '@/view/inspection/InspectionRegisterList'
import InspectionRegister from '@/view/inspection/InspectionRegister'
{
          path: '/inspection/inspectionRegisterList',
          component: InspectionRegisterList,
          name: 'inspectionRegisterList'
        },
        {
          path: '/inspection/inspectionRegisterList/inspectionRegister',
          component: InspectionRegister,
          name: 'inspectionRegister'
        },

跳转后的页面 使用 this.$route.query 进行接收

 

当使用 param进行参数传递的时候

我们使用 name 名称进行跳转页面的设置 同时 需要注意的是 params:{ item }

 

跳转后页面 使用 this.$route.params.item

 

posted @ 2018-07-06 21:04  journeyIT  阅读(60)  评论(0)    收藏  举报