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

    Q-Select, Toggle, and emitting events

    Help
    3
    3
    1487
    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.
    • D
      dlevin last edited by

      I recently tried to pass an array from Vuex state into a q-select component of type ‘toggle’ and noticed that the select-component modifies the array in place without emitting events. This obviously breaks the Vuex pattern and prevents me from doing this:

      skills: {
        get () {
          return this.$store.getters['ALL_SKILLS']
        },
        set (values) {
          this.$store.commit('SET_SKILLS', values)
        }
      }
      

      To work around this I created a local array in the component itself and then watch that array for changes. If there’s a change, I call the Vuex mutation. This solution works, but is there a way I can get the above code to work with q-select of type ‘toggle’?

      1 Reply Last reply Reply Quote 1
      • J
        johnorford last edited by

        I am also wondering about this - any neat solutions?

        1 Reply Last reply Reply Quote 0
        • rstoenescu
          rstoenescu Admin last edited by

          Use @change event. On change, commit to the store.

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