Tag:$router $route
Category:VUE
Article From:https://www.cnblogs.com/mengfangui/p/9124675.html

When making a project, it is found that the parameters passed through this.$route.query or this.$route.params receive the parameters of router-link.

In the route jump, there is a way to write this.$router.push in the script tag (‘the path name for the jump’), in addition to the script tag that needs to be skipping in the event with the router-link tag.

 When writing, discover why these two are different. When the console is playing this, it is found that $route and $router exist simultaneously.

 

$routeFor the current router jump object, you can get name, path, query, params, etc.

$routerFor the VueRouter instance, if you want to navigate to different URL, use the $router.push method.

Returning to the last history is also using the $router.go method

 

Transfer from: https://blog.csdn.net/zzz_zed/article/details/78885944

Leave a Reply

Your email address will not be published. Required fields are marked *