fix: table ts error

v2.3
tangjinzhou 2021-09-22 13:40:56 +08:00
parent ca6ce42819
commit b22c654bae
3 changed files with 6 additions and 4 deletions

View File

@ -653,7 +653,8 @@ const Table = defineComponent<TableProps>({
table,
});
return () => {
const columns = attrs.columns || convertChildrenToColumns(slots.default?.());
const props = attrs as TableProps;
const columns = props.columns || convertChildrenToColumns(slots.default?.());
return (
<InteralTable
ref={table}

View File

@ -25,7 +25,7 @@ describe('Table.pagination', () => {
props: {
columns,
dataSource: data,
pagination,
pagination: { ...pagination },
...props,
},
sync: false,

View File

@ -57,8 +57,9 @@ import MultipleSorter from './multiple-sorter.vue';
import Summary from './summary.vue';
import CN from '../index.zh-CN.md';
import US from '../index.en-US.md';
import { defineComponent } from '@vue/runtime-core';
export default {
export default defineComponent({
CN,
US,
components: {
@ -88,5 +89,5 @@ export default {
MultipleSorter,
Summary,
},
};
});
</script>