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

    Two way bindings with q-select

    Help
    1
    2
    428
    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.
    • J
      jvdb last edited by

      Hello I’m facing an issue trying to implement two way binding on a q-select component

      <q-field helper=“Height”>
      <q-select inverted-light color=“lime”
      v-model=“height” :options=“heightOptions” />
      </q-field>

      computed: {
      height: {
      get() {
      return this.$store.state.auth.User.userStats.height;
      },
      set(value) {
      this.$store.commit(‘auth/SAVE_USER_PROP’, ‘height’, value);
      },
      },
      heightOptions() {
      const heightArray = [];
      for (let pas = 100; pas < 251; pas += 1) {
      heightArray.push({ value: pas, label: pas.toString() });
      }
      return heightArray;
      },
      },

      On page load q-select have the good value coming from the store (vuex) and when I change the value of q-select the store is correctly updated but the value of q-select stay the same.

      Do I need to do something to refresh the component ?

      Thanx all

      1 Reply Last reply Reply Quote 0
      • J
        jvdb last edited by

        I answer myself, I uses nested objects so reactivity observer are not created.
        Solution is to declare the full hierarchy of m nested object.

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