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, table,
}); });
return () => { return () => {
const columns = attrs.columns || convertChildrenToColumns(slots.default?.()); const props = attrs as TableProps;
const columns = props.columns || convertChildrenToColumns(slots.default?.());
return ( return (
<InteralTable <InteralTable
ref={table} ref={table}

View File

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

View File

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