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

    Problems with Vuex in a Typescript + Composition API project

    Help
    2
    2
    1211
    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.
    • W
      WelshLlama last edited by

      Hello, I’m having some problems accessing my Vuex store, specifically through the composition API, and would appreciate any help.

      The file structure for my store is this:
      85a948db-ce2a-41b4-8eeb-e56885273831-image.png

      This is my root index.ts file:
      6877ccdb-2e04-4653-896e-3d7d70206a8a-image.png

      Assuming that’s set up properly, I want to access my store inside a Vue component. I’m using the composition API, and the Vuex docs suggest something like this:
      18dfdb83-aaad-443e-97d0-51a6e1a5fa79-image.png

      But this gives me an error:

      Module '"vuex"' has no exported member 'useStore'. Did you mean to use 'import useStore from "vuex"' instead?Vetur(2614)

      Does anyone have any pointers? Or even an example quasar project with typescript and the composition API that I could look at?

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

        @welshllama said in Problems with Vuex in a Typescript + Composition API project:

        Module ‘“vuex”’ has no exported member ‘useStore’. Did you mean to use 'import useStore from “vuex”

        See this thread for a solution:
        https://github.com/vuejs/vuex/issues/1736

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