history mode for web and not for cordova
-
Is anyone doing this? Is it as simple as using Platform.is.cordova to set the history mode on the router? Any quirks to be aware of?
-
I haven’t tried doing this myself but I can’t immediately think of a reason that this would not work. I would suggest giving it a try and let me know if there are any errors with it.
-
Matt, thanks for the reply. I’ll give it a go in the project I am about to start and post my findings.
-
Yes, I did : mode: (Platform.is.cordova ? ‘’ : ‘history’).
Works perfectly -
Thanks Nicholas for your confirmation.
-
// VueRouter "history" mode DOESN'T works for Cordova builds, it is only to be used only for websites. // If you decide to go with "history" mode, please also open /config/index.js and set "build.publicPath" to something other than an empty string. (Example: '/' instead of current '') // If switching back to default "hash" mode, don\'t forget to set the build publicPath back to '' so Cordova builds work again.
So, is need change the /config/index.js file too. How get Platform.is.cordova value inside this file?
-
@philliperosario Do you find issues in cordova if publicPath is set to ‘/’ ? I have yet to get that far, so I’d be interested to know.
-
This post is deleted! -
@smakinson So far, no error!
-
I am seeing problems with assets in the statics directory.
I am looking for a way to flag the build so that config/index.js can react to it and use “” or “/” as needed. My first thought is to pass a 3rd arg to the build like:
quasar build mat cordova
but its not picking up that last arg, so I’m assuming the build script must not pass it along.
@rstoenescu If you have a moment do you have an opinion on this? It will be appreciated!
-
node build/script.build.js ios cordova
Does the trick for getting arg[3], but it seems this is not helping with the statics not being found in the emulator. Hmm