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 use replaceState in mutations ?

    Help
    3
    4
    267
    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.
    • AtChA
      AtChA last edited by

      Hello all.
      I would like to replaceState with localStorage data.
      Unfortunately, i don’t understand how i can access to the Vuex Store object in mutations.js file.
      Can you help me ?

      Thanks in advance.

      metalsadman 1 Reply Last reply Reply Quote 0
      • patryckx
        patryckx last edited by

        By default a mutation is given a state parameter.

        e1723784-17b3-4774-a94e-9dfe76f8a3e1-image.png

        Consult: https://vuex.vuejs.org/guide/mutations.html

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman @AtChA last edited by

          @AtChA said in How to use replaceState in mutations ?:

          Hello all.
          I would like to replaceState with localStorage data.
          Unfortunately, i don’t understand how i can access to the Vuex Store object in mutations.js file.
          Can you help me ?

          Thanks in advance.

          You could use vuex-persistedstate plugin to save your store states in localstorage, so a page refresh will still persist your states.

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

            Thx guys.
            In fact i was searching too far ><. @patryckx effectively, i’ve just put my localStorage.getItem result into my state.
            Sometimes i’m just so into it and i can’t see above my nose :d.
            I close the topic.

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