Skip to content

vue/no-v-text-v-html-on-component: it should not warn if a component implements default slot #2431

Open
@mitar

Description

@mitar

What rule do you want to change?

vue/no-v-text-v-html-on-component

Does this change cause the rule to produce more or fewer warnings?

Fewer warnings (less false positives).

How will the change be implemented? (New option, new default behavior, etc.)?

New default behavior.

Please provide some example code that this change will affect:

<template>
  <div class="wrap"><slot /></div>
</template>

<MyComponent v-html="foobar" />

What does the rule currently do for this code?

It complains with vue/no-v-text-v-html-on-component.

What will the rule do after it's changed?

It does not complain. Because there is default slot defined, v-html is correctly used for the slot content and does not remove the wrap div.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions