Pattern: Use of v-text
/v-html
on component
Issue: -
If you use v-text
/v-html
on a component, it will overwrite the component's content and may break the component.
<template>
<!-- ✓ GOOD -->
<div v-text="content"></div>
<div v-html="html"></div>
<MyComponent>{{content}}</MyComponent>
<!-- ✗ BAD -->
<MyComponent v-text="content"></MyComponent>
<MyComponent v-html="html"></MyComponent>
</template>