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 do I access the local file under Electron mode in my Quasar project ?

    Help
    3
    5
    1085
    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.
    • T
      tangmemgyu last edited by

      Help wanted description

      I’m pretty sure about that I can use some Node.js builtins’ module like fs and path, but I don’t know how to use them in my Vue SFC(single file component).

      My requirements

      I have a form in my Settings.vue, it will accept three fields, I will put them into an object :

      {  // (type: LinkTemplate)
        name: 'Google',
        template: 'https://www.google.com/search?q={%s}'
        desc: 'xxx ... some comments here.'
      },
      

      I’d like to load an Array<LinkeTemplate> from a local json file.
      but I don’t know how to use the fs Node.js API here.

      Something else need to learn?

      I do know that Electron has two independent process Main and Render.
      How do I use the System Level API (like File I/O) easily in a complicated Web Application like Quasar?
      It seems I need a lot of Directory Tricks and Config Settings.

      It seems that there’s nothing useful for this at the official documentation of Quasar.

      Thanks !

      1 Reply Last reply Reply Quote 0
      • T
        tangmemgyu last edited by

        Email: tmy991106@gmail.com
        This Email may make our communication more convenient …

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

          @tangmemgyu

          If you want info about specific Electron features you are often better helped in the Electron community:
          https://www.electronjs.org/community

          On topic, here’s a thread about file access:
          https://stackoverflow.com/questions/55983687/asynchronously-read-a-file-line-by-line-with-electron-vue

          Also googled this ‘book’ about vue and electron:
          https://simulatedgreg.gitbooks.io/electron-vue/content/en/

          https://simulatedgreg.gitbooks.io/electron-vue/content/en/savingreading-local-files.html

          Btw no emailing, otherwise other Quasar community members will not be able to see potential solutions.

          1 Reply Last reply Reply Quote 0
          • T
            tangmemgyu last edited by

            @dobbel Thanks!
            And Now I’ve already implemented my application in DEV mode !! but unfortunately…
            I HAVE NO IDEA HOW TO BUILD IT !!

            In dev mode, I can see my system tray icon in status bar.
            but after reading the documentation ( No offense but it is still not enough for how to build and package. just a quasar build -m electron … )
            I run the build command and everything seems fine.
            but the production can’t show tray icon any more.
            btw, in main-process/electron.main.js I used global variable __statics

            is there anyone can help…

            M 1 Reply Last reply Reply Quote 0
            • M
              mingzai84 @tangmemgyu last edited by

              @tangmemgyu see the topic Tray icon not showing in production(Electron)

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