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

    How to open a specific route in an Electron BrowserWindow?

    Help
    3
    7
    987
    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
      mitchartemis last edited by

      Hi!

      I’m working on an Quasar Electron app that has a button which needs to show a specific route in a pop-up window.

      So far, I have tried a generic <a> tag with _blank, and also tried opening a new BrowserWindow by using ipcMain and ipcRenderer but the page that loads is empty.

      I have tried opening ${__dirname}/index.html#/page and although the basic HTML seems to show when I inspect it (I.e. the #app element and core head/body stuff) none of the Vue DOM shows.

      Does anyone know how I can achieve this?

      Thanks!

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @mitchartemis last edited by

        @mitchartemis

        https://quasar.dev/quasar-utils/other-utils#Open-External-URL

        M 1 Reply Last reply Reply Quote 0
        • M
          mitchartemis @dobbel last edited by

          @dobbel thanks, but unless I’m mistaken this is for opening an external website URL. I am trying to open an internal URL.

          dobbel 1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @mitchartemis last edited by

            @mitchartemis

            https://quasar.dev/vue-components/button#Example--Links

            just use the to attribute

            M 1 Reply Last reply Reply Quote 0
            • M
              mitchartemis @dobbel last edited by

              Thanks for the link @dobbel

              I see there’s an on-click event that can be used as well. Is it possible to alter the url it’s going to when clicked?

              When I click the link/button, I want to fetch a unique ID from my API, and then open the route in a new window with the route parameter generated from the API.

              dobbel 1 Reply Last reply Reply Quote 0
              • dobbel
                dobbel @mitchartemis last edited by

                @mitchartemis

                Yes of course, there are multiple ways to do this.

                1. you can use the vue router to fetch/do something before it goes to a route. (probably best option )
                  https://medium.com/js-dojo/vue-router-route-resolvers-e7d09c991b58

                2. Remove the button to url . Replace it with a @click event to the button. Then in the clickhandler: make a call to your api and on succes, do a router.push({name: 'you-route', params:{foo:'bar'}}).
                  https://stackoverflow.com/questions/40382388/how-to-set-url-query-params-in-vue-with-vue-router

                1 Reply Last reply Reply Quote 0
                • D
                  dhavald99 last edited by

                  hi @mitchartemis did you find anything about that BrowserWindow internal URL ? i m trying to achieve same and didn’t working. Thanks

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