Skip to content

开启ESLint时,折叠面板 (collapse-panel) 使用v-for,key与组件bind的属性key冲突 #3623

@LuCatIsFun

Description

@LuCatIsFun
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.6.2

Environment

"vue": "^2.6.10"

Reproduction link

https://github.com/vueComponent/ant-design-vue

Steps to reproduce

  <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}">
    <a-collapse :accordion="true">
      <a-collapse-panel
        v-for="item in items"
        :key="1"  // 这里
        header="This is panel header 1"
       >
         <p>{{ item.text }}</p>
       </a-collapse-panel>
    </a-collapse>
  </a-card>

What is expected?

除了关闭ESLint检查,有其他的方法能规避掉这个问题吗

What is actually happening?

我想使用v-for渲染一个折叠面板,ESLint 提示与v-for的key冲突了

image

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