Jump method: 1. Use the "
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
router-view is where routing content is implemented. When introducing components, write the place where they need to be introduced.
It should be noted that router-view must be used as a container when using vue-router to control routing.
Three ways to jump through routing
1. router-link [The simplest method to achieve jump]
When the browser parses it, it parses it into a tag similar to < a >.
#div和css样式略
Don’t forget to introduce the path that needs to be jumped under router/index.js in advance.
[Related recommendation: "vue.js Tutorial"]
2. this.$router.push({ path: '/user'})
is often used to pass parameters in routes. The usage is the same as the third type
. The difference is:
1), query introduction method
params can only use name to introduce routes
And query must be introduced with path
2), query delivery method
is similar to get parameters in our ajax, in Displaying parameters
params in the browser address bar is similar to post. Parameters are not displayed in the browser address bar
in the helloworld.vue file
.....验证路由传参
in select. In the vue file,
3 and this.$router.replace{path: '/'} are similar and will not be repeated.
For more programming-related knowledge, please visit : Programming Video! !
The above is the detailed content of What are the three ways to jump in Vue routing?. For more information, please follow other related articles on the PHP Chinese website!