An Essential Guide to Re-rendering Vue Routes When Path Parameters Changeby@wagslane
725 reads
725 reads

An Essential Guide to Re-rendering Vue Routes When Path Parameters Change

by Lane Wagner2mSeptember 4th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

A common problem occurs when a user alters the path in the address bar manually. Manually changing the path does not rerender the view. This can cause unexpected behavior because mounted() hooks don't fire and nested components don't reload. The solution is to use another hook, beforeRouteUpdate(). The last parameter in the Qvault Playground's path is the code language, "js" or "go". If the boilerplate code were only fetched using a mounted() hook, then the code would not reload. You can set your entire router-view to re-render when its path changes.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - An Essential Guide to Re-rendering Vue Routes When Path Parameters Change
Lane Wagner HackerNoon profile picture
Lane Wagner

Lane Wagner

@wagslane

Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

About @wagslane
LEARN MORE ABOUT @WAGSLANE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Lane Wagner HackerNoon profile picture
Lane Wagner@wagslane
Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here