Performance: Custom v-model on components
MEDIUM IMPACT
This affects how component state updates propagate and how often the DOM updates due to two-way binding.
<CustomInput v-model="inputValue" /> // Inside CustomInput emits 'update:modelValue' event only
<CustomInput v-model="inputValue" @input="val => inputValue = val" />
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Manual event sync with extra listeners | Multiple reactive updates | 2+ reflows per input | Higher paint cost due to repeated DOM patches | [X] Bad |
| Single 'update:modelValue' event emission | Single reactive update | 1 reflow per input | Lower paint cost with minimal DOM patches | [OK] Good |