Skip to content

Dynamic slot names marked as "same slot" #1348

Closed
@sugoidesune

Description

@sugoidesune

Tell us about your environment
"eslint": "^4.19.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.1",
"eslint-plugin-vue": "^4.0.0",

  • Node version: 12
  • Operating System: Windows

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    parser: 'babel-eslint'
  },
  extends: [
    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
    'plugin:vue/essential'
  ],
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {}
}

What did you do?

<template v-for="col in editables" v-slot:[col.slot]="{ item }" >
          <span :key="col.value">{{col.edit}}</span>
        </template>

        <template v-for="col in checkmarks"  v-slot:[col.slot]="{ item }">
          <span :key="col.value">
{{col.checkmark}}
          </span>
        </template>

image

What did you expect to happen?
No error, the slot names are infact different, but the API is the same for looping through them.

What actually happened?
An element cannot have multiple '<template>' elements which are distributed to the same slot.
image

Repository to reproduce this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions