No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    history mode for web and not for cordova

    Framework
    4
    11
    3911
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      smakinson last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • matt
        matt last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • S
          smakinson last edited by

          Matt, thanks for the reply. I’ll give it a go in the project I am about to start and post my findings.

          1 Reply Last reply Reply Quote 0
          • N
            Nicholas last edited by

            Yes, I did : mode: (Platform.is.cordova ? ‘’ : ‘history’).
            Works perfectly 🙂

            1 Reply Last reply Reply Quote 3
            • S
              smakinson last edited by

              Thanks Nicholas for your confirmation.

              1 Reply Last reply Reply Quote 1
              • P
                philliperosario last edited by philliperosario

                // 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?

                1 Reply Last reply Reply Quote 0
                • S
                  smakinson last edited by smakinson

                  @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.

                  P 2 Replies Last reply Reply Quote 0
                  • P
                    philliperosario @smakinson last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • P
                      philliperosario @smakinson last edited by

                      @smakinson So far, no error!

                      1 Reply Last reply Reply Quote 0
                      • S
                        smakinson last edited by

                        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!

                        1 Reply Last reply Reply Quote 0
                        • S
                          smakinson last edited by

                          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

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post