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

    Vuex Getters and Typescript errors

    Help
    1
    1
    460
    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
      matt-h last edited by

      Hi there,

      I have a quasar project which uses Vuex and the Composition API. I have enabled typescript and I’ve added Cordova.

      I have a component which needs to pull a boolean value from a getter in my store module like so:

      const flag = computed(() => store.getters['test/flag'])
      

      the code works fine while I’m developing, but if I try to build it, I get the following typescript errors:

      106:33  error  Unsafe member access ['test/flag'] on an any value  @typescript-eslint/no-unsafe-member-access
      106:33  error  Unsafe return of an any typed value                 @typescript-eslint/no-unsafe-return
      

      Let me know if I need to provide additional info, I have an example project which I can provide if necessary.

      Can anyone tell me what I need to do to safely use getters in my typescript component?

      Thanks,
      Matt

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