Performance: Raw HTML with v-html
MEDIUM IMPACT
Using v-html affects rendering speed and visual stability by injecting raw HTML directly into the DOM.
<div>{{ sanitizedText }}</div><div v-html="rawHtmlContent"></div>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using v-html with dynamic content | Inserts multiple nodes dynamically | Triggers reflow on each update | High paint cost due to layout shifts | [X] Bad |
| Rendering sanitized text without v-html | Minimal DOM changes | No reflows from HTML injection | Low paint cost | [OK] Good |