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

    Can't access subroutes as entry point/HR not working when in subroute

    Help
    3
    3
    1378
    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.
    • M
      mariaczi last edited by mariaczi

      I have my routes:

      {
            path: '/panel',
            component: panel,
            beforeEnter: reqAuth,
            children: [
              { path: '', component: epPanelHome },
              { path: 'events', component: epPanelEvents },
              { path: 'groups', component: epPanelGroups }
            ]
          },
      

      I can’t run app from link: localhost:8080/panel/events or groups

      I can access localhost:8080 or localhost:8080/panel but not any subroute…
      I can run subroutes with links and it’s working ok (almost)

      The issue is somehow about config or something?
      GET http://localhost:8080/panel/js/app.js when I think it should not add /panel
      Anyone with the same problem?

      EDIT: got reply on vue-router guthub. I had to disable history mode for dev.
      Do you think it’s possible to use history mode with webpack ?

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

        I vaguely remember having to write out the full paths like this.
        Not sure if this is the correct way. Feels like a bit of overhead.
        (still have to sit down for a day and read the vue-router manual from A to Z 😉

              path: '/panel',
              component: panel,
              beforeEnter: reqAuth,
              children: [
                { path: '/panel/home', component: epPanelHome },
                { path: '/panel/events', component: epPanelEvents },
                { path: '/panel/groups', component: epPanelGroups }
              ]
            },
        

        in the vue component:

        router.push(
                  {
                    path  : '/panel/events',
                    exact : true
                  }
                )
        
        1 Reply Last reply Reply Quote 0
        • rstoenescu
          rstoenescu Admin last edited by

          It’s a matter of correctly setting up the publicPath. Use “/” for both dev and build publicPaths when on History Mode.

            /*
             * NOTE! 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.
             */
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post