element-plus [Component] [table-v2] Virtualized Table estimated-row-height doesn't work if there is no "id" key in data array

68bkxrlz  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(58)

Bug Type: Component

Environment

  • Vue Version: 3.3.4
  • Element Plus Version: 2.3.9
  • Browser / OS: chrome / Ventura 13.5
  • Build Tool: Vite

Reproduction

  • el-table-v2

Element Plus Playground

Steps to reproduce

<template>
  <el-table-v2
    :columns="columns"
    :data="data"
    :estimated-row-height="40"
    :width="700"
    :height="400"
    fixed
  />
</template>

<script lang="ts" setup>

const data =[{
any: `random`,
description: 'Quaerat ipsam necessitatibus eum quibusdam est id voluptatem cumque mollitia.',
}]

const columns = [
{
key: 'any',
title: 'Id',
dataKey: 'any',
width: 150
},{
key: 'description',
title: 'Description',
dataKey: 'description',
width: 150
}
]
</script>

What is Expected?

column description should have dynamic height

What is actually happening?

column description has a fixed height

Additional comments

works only if data has "id" key

<script lang="ts" setup>

const data =[{
id: `random`,
description: 'Quaerat ipsam necessitatibus eum quibusdam est id voluptatem cumque mollitia.',
}]

const columns = [
{
key: 'id',
title: 'Id',
dataKey: 'id',
width: 150
},{
key: 'description',
title: 'Description',
dataKey: 'description',
width: 150
}
]
</script>

相关问题