bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.77k stars 1.32k forks source link

Determining initial page load #94

Closed alexdilley closed 5 years ago

alexdilley commented 5 years ago

I see you use the [lack of] presence of a route name (here) to determine whether a navigation is the initial page load (where Vue Router appears to have [an unnamed version of] the root path set as the from route when the page is first loaded). But what if I define a route in my app that I don't/forget (bad practice, maybe!) to name? I've hunted for another way to determine whether a view is rendered as a result of, say, refreshing the page, but I can't see anything – I guess access to the history stack/length could provide a solution. I see you've opened an issue relating to gaining access to the referer (tradition denotes you should spell it wrong (:) – does this allude to a potential omission of Vue Router that could be explored, do you think? I suppose it is earmarked for v3 so perhaps this point is moot post the next release...

chrisvfritz commented 5 years ago

That's a great point about route.name! 🙂 I just updated the router to check for null specifically, so now accidentally leaving the name out shouldn't cause an issue.

alexdilley commented 5 years ago

I just updated the router to check for null specifically, so now accidentally leaving the name out shouldn't cause an issue.

👍 nice.

Great to meet you at Vue London, albeit briefly. I hope you had an enjoyable trip over.

chrisvfritz commented 5 years ago

Great to meet you as well! 🙂