Q-range: How to show button on lazy model change



  • I’m trying to show an element on @change event in q-range.
    The following doesn’t work:

    @change="() => { showButton = true }"

    What am I doing wrong? This simple pattern works with @input event. Also, I want to use lazy model change only for displaying the button, but not for the model values rendered in labels or elsewhere.
    Thank you.



  • try <q-range :value="yourModel" @change="val => { showButton = true }; orCallOtherFunctionHere();" />, you can also do the same for @input, like so @input="firstFunctionCall(); secondFunctionCall();" or a statement @input="someFunction(); showButton = true".



  • metalsadman,

    Thank you for your suggestions, I have tried them all well previously and now I found the issue was that I was using lazy model change with @change event and v-model at the same time. Lazy @change works only without v-model. However, I wanted to render some changes via v-model in real time (like values on q-range labels when moving the slider), and display some elements, like buttons, only on lazy model change. I wonder if such a combination is possible?


Log in to reply