Skip to content

Descriptions Item 组件不能使用 v-for #2793

@ununian

Description

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

Version

2.0.0-beta.5

Environment

win10

Reproduction link

https://vuecomponent.github.io/issue-helper/

Steps to reproduce

<template>
  <div>
    <a-descriptions title="User Info" bordered :column="2">
      <a-descriptions-item label="test">
        test
      </a-descriptions-item>
      <a-descriptions-item v-for="(prop, index) in vals" :key="index" :label="prop.name">
        {{ prop.type }}
      </a-descriptions-item>
    </a-descriptions>
    <div v-for="(prop, index) in vals" :key="index">
      {{ prop.type }}
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      vals: [
        { id: 1, name: 'prop1', type: 'text' },
        { id: 2, name: 'prop2', type: 'text' },
      ],
    };
  },
};
</script>

What is expected?

显示 3 个 descriptions-item 和 2个 div

What is actually happening?

只显示了 1 个固定的 descriptions-item 和 2 个div
image


vue3中 v-for 渲染为 Fragment,descriptions代码里面 clone 子项的时候没有考虑到 Fragment的情况

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