Skip to content

fix: descriptions not render fragmet children #2794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ununian
Copy link
Contributor

@ununian ununian commented Sep 4, 2020

First of all, thank you for your contribution! 😄

New feature please send pull request to feature branch, and rest to master branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

This is a ...

  • Bug fix

What's the background?

#2793

  1. Chinese description (optional)

v-for 在 vue 3 中渲染为 Fragment,在 Descriptions 获取 children 的时候增加 isFragment 判断,并用 flatMap 组合起来

<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>

before:
微信截图_20200904155420

after:
微信截图_20200904155439

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Additional Plan? (Optional if not new feature)

If this PR related with other PR or following info. You can type here.

@tangjinzhou
Copy link
Member

b616823

@tangjinzhou tangjinzhou closed this Sep 7, 2020
@github-actions
Copy link

github-actions bot commented Sep 8, 2021

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants