Performance: v-model modifiers (lazy, number, trim)
MEDIUM IMPACT
These modifiers affect how and when input data updates the Vue component state, impacting interaction responsiveness and rendering frequency.
<input v-model.lazy="text" /><input v-model="text" />| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| v-model without modifiers | Updates on every input event | Triggers reflow per keystroke | High paint cost due to frequent updates | [X] Bad |
| v-model.lazy | Updates on change event only | Single reflow per input blur | Lower paint cost | [OK] Good |
| v-model.number | Converts input to number on update | No extra reflows | Minimal paint cost | [OK] Good |
| v-model.trim | Trims whitespace before update | No extra reflows | Minimal paint cost | [OK] Good |