Closed mrksbnch closed 5 years ago
Maybe I misunderstand you but when you say:
Open index.html file in /dist
Do you use any webserver to open your application or you just open the html file in your browser ?
I'm using a webserver, so the JavaScript / CSS files are correctly loaded (I doubled checked in Chrome Dev Tools and the JavaScript is loaded correctly).
Not really related to that issue but the ability to set a base path (so we don't have to start a webserver every time would be great too to test locally)
Sorry I cannot reproduce it, everything works as expected on my tests: Vue Router handle correclty the navigation when a router link is clicked
@chymz I just noticed that it was a configuration issue on my end and it is indeed working correctly. Sorry!
Describe the bug
I want a create a prerendered SPA page (
npm run ssr:static
) that is using soft reload (using Vue Router in history mode) to link to different pages instead of performing a hard reload.To Reproduce
npm run ssr:static
Reproduction repo
Expected behavior
If you click on the link in index.html ("Go to subpage"), Vue Router (in history mode) is used to redirect (instead of a hard reload).
Additional context
I want to host a website on Github Pages that needs to keep the store when going to seperate pages (SPA behavior). As I can't use Node.js on Github pages and a hard reload will lose all data that is kept in Vue Store (unless you save that in e.g. localstorange) and is also much slower than a soft reload using Vue Router, I'm wondering if I can generate static HTML files and still use Vue Router to link to different pages (in case JS is enabled)?
Please indicate versions of: