[Vuejs]-How to avoid Infinite Loop in vue.js watcher and socket.io

0👍

Bind action to an event, like @input or @change insted of v-model value, get rid of watcher and try something like this:

<input class="..."
       step="3"
       min="0"
       max="255"
       v-model="value"
       type="range"
       :disabled="disabled"
       @input="sendChange()">

This way you send request only when user intentionally changes his value, not when value updates by any mean.

Leave a comment