The route passes the entire object
Query The parameter object
❓ is still lost after refreshing
✅ JSON package to pass the JSON string, and parse when retrieving (why JSON package? Passing an object directly will lose both query and Params.
Parmas Parameter transfer object
❓ has been made persistent stored in the local, but after stored in the local and then taken out why a refresh error
💬 The problem is that json.parse already handles data that does not exist. A refresh error occurs
Make a judgment SingleUesrInfo ✅ definition: enclosing $route. Params. SingleUesrInfo? JSON. Parse (this. $route. Params. SingleUesrInfo) : “” rather than direct parse
Parameter transfer logic of multi-layer deep jump
🌰 A is the user list page,B user details, C user interaction results, A to B to C Page C requires user ID of A and all task data on B
❓ Then how to transfer the user information I click on the page A to B, and then transfer the detailed data on B + the user data on A to C?
✅ The detailed suggestions in B should be stored in vuex
A only transfers user ID to B, clicking on which user will save the corresponding task data of which user in VUex. When B jumps to C, IT will only transfer ID. C page will first store the ID locally, and then go to C page and use THE ID as the bottom pocket. If not (page refresh scenario) re-request the data by ID
Note the other two questions below:
- If I want to pass the whole object, when do I overwrite the dynamic parameters after path?
- How do you pass an entire parameter decoupled?