JS-banana / vite-vue3-ts

vite、vue3、script setup、TypeScript、pinia、ant-design-vue
https://js-banana.github.io/vite-vue3-ts/
MIT License
360 stars 101 forks source link

Actions not worker after antd vue upgrade to 3.0 #3

Closed incubator4 closed 2 years ago

incubator4 commented 2 years ago

The Component Table custom actions with

<template #bodyCell="{ column, text, record }">
  <template v-if="column.slots?.customRender === 'action'">
    <!-- etc -->
  </template>
</template>

But in ant design vue 3.x, it says Table deprecated column.slots, added v-slot:bodyCell, v-slot:headerCell, custom cells, and added column.customFilterDropdown v-slot:customFilterDropdown, custom filtering Menu, added v-slot:customFilterIcon custom filter button, but column.slots is still available, we will remove it in the next major version.

After add slots prop into columns , for example

export const columns: ColumnProps[] = [
  {
    title: 'Name',
    dataIndex: 'name',
    width: 150,
  },
  {
    title: 'Action',
    width: 120,
    slots: {
      customRender: 'action',
    },
  },
]

It doesn't behave as expected, render elements in