The method of routing data transfer jump vue

1. $ router.push stitching parameters of mass participation

this.$router.push('/editCardetail?editType=add')

2, using the name of the route to determine a match, to pass parameters params

this.$router.push({
			          name: 'login',
			          params: {
			            editType: add
			          }
			        })

3, used to match the routing path, and then to pass query parameters

this.$router.push({
			         path: '/login',
			          query: {
			            editType: add
			          }
			        })

  

Note that path can not be used with params, by the need to match the routing path when the query used to pass parameters.
introducing path to use query, use the params name is introduced, the received parameters are similar, and are this.route.query.name this. route.query.name and this.route.query.name and this.route .params.name.
ajax query is more similar to what we get in mass participation, params is similar to the post, the former display parameters in the browser address bar, the latter will not be displayed

In the routing inside wording is:

, {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue'),
    }, 

Guess you like

Origin www.cnblogs.com/aloneindefeat/p/11090721.html