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

    Fix tslint issue on Quasar component (getting the value from the Vuex Store)

    Framework
    typescript vue quasar vuex
    2
    6
    237
    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.
    • forevereffort
      forevereffort last edited by

      At Quasar, I am using root.$store.getters to get the values from the Vuex Store. but as Quasar is based on typescript, I got the tslint issue like the following image.

      du5ST.png

      please help me how I fix the above tslint issue.

      Regards

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

        @forevereffort said in Fix tslint issue on Quasar component (getting the value from the Vuex Store):

        but as Quasar is based on typescript

        I don’t thinks so.

        You could disable eslint for some lines of code:
        https://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line

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

          hello @dobbel thanks for your comment. but instead of disabling eslint, if possible, can I define the correct type for root.$store.getters[‘app/filter’]?

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

            @forevereffort

            Here’s an article that might help:
            https://medium.com/swlh/properly-typed-vuex-stores-427bf4c6a3d1

            The repo that gives vuex types:
            https://github.com/mrcrowl/vuex-typex

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

              @dobbel said in Fix tslint issue on Quasar component (getting the value from the Vuex Store):

              @forevereffort

              Here’s an article that might help:
              https://medium.com/swlh/properly-typed-vuex-stores-427bf4c6a3d1

              The repo that gives vuex types:
              https://github.com/mrcrowl/vuex-typex

              Hello @dobbel

              by using vuex-composition-helpers, I fixed the above issues. my working code like the following.

              a.png

              as you see, is this good solution?

              Regards

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

                @forevereffort

                Sure if it works and you have types now.

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