JS.VUE.NO.V.TEXT.V.HTML.ON.COMPONENT

Usage of v-text or v-html on component

Rule Details

This rule disallows the use of v-text / v-html on component.

If you use v-text / v-html on a component, it will overwrite the component's content and may break the component.

{'vue/no-v-text-v-html-on-component': ['error']}

Copy
<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>

Options

Nothing.

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/