Skip to content

[vue] slots.default is not a function #146

@Tofandel

Description

@Tofandel

Using the component using slot="first" conflicts with vue and should instead use real vue slots with the slot attribute, because with the recommended eslint settings (https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html) the following becomes:

  <img slot="first" src="before.jpg" />
  <img slot="second" src="after.jpg" />
<template #first>
  <img src="before.jpg" />
</template>
<template #second>
  <img src="after.jpg" />
</template>

Which results in no default slot and the error slots.default is not a function

The configuration of this eslint rule does not allow ignoring for a parent component and thus this rule has to be entirely disabled if this lib is used

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions