Text plus code to understand the difference between dynamic routing and nested routing in vue

First, the difference between dynamic routing and nested routing

First look at the effect
Insert picture description here
the difference:

  • From the form of view: there is one / in the path of the dynamic routing url, and two / in the path of the nested routing url
  • Essentially: dynamic routing url corresponds to one component, nested routing url corresponds to two components

effect:

  • Dynamic routing: realize the dynamic change of path value
  • Nested routing: implement child routing under parent routing

Second, the code implementation process

Dynamic routing

Insert picture description here
When you change the value of the userId attribute in App.vue, the value displayed by the url will also be different
.

Nested routing

Insert picture description here
The 1234 in the picture is the process of code execution. If you go through the code execution order in your mind, you will see the
effect
Insert picture description here

3. Summary

This knowledge point has thought about the code execution order for a day. I have done it twice in ppt. Csdn summarized it and finally understood it, so I must summarize it and master the essence of programming

Published 229 original articles · praised 113 · 100,000+ views

Guess you like

Origin blog.csdn.net/shang_0122/article/details/105702774