|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<Table
|
|
<Table
|
|
- v-if="summaryFunc"
|
|
|
|
|
|
+ v-if="summaryFunc || summaryData"
|
|
:showHeader="false"
|
|
:showHeader="false"
|
|
:bordered="false"
|
|
:bordered="false"
|
|
:pagination="false"
|
|
:pagination="false"
|
|
@@ -32,6 +32,9 @@
|
|
summaryFunc: {
|
|
summaryFunc: {
|
|
type: Function as PropType<Fn>,
|
|
type: Function as PropType<Fn>,
|
|
},
|
|
},
|
|
|
|
+ summaryData: {
|
|
|
|
+ type: Array as PropType<Recordable[]>,
|
|
|
|
+ },
|
|
scroll: {
|
|
scroll: {
|
|
type: Object as PropType<Recordable>,
|
|
type: Object as PropType<Recordable>,
|
|
},
|
|
},
|
|
@@ -41,7 +44,11 @@
|
|
const table = useTableContext();
|
|
const table = useTableContext();
|
|
|
|
|
|
const getDataSource = computed((): Recordable[] => {
|
|
const getDataSource = computed((): Recordable[] => {
|
|
- const { summaryFunc } = props;
|
|
|
|
|
|
+ const { summaryFunc, summaryData } = props;
|
|
|
|
+ if (summaryData?.length) {
|
|
|
|
+ summaryData.forEach((item, i) => (item[props.rowKey] = `${i}`));
|
|
|
|
+ return summaryData;
|
|
|
|
+ }
|
|
if (!isFunction(summaryFunc)) {
|
|
if (!isFunction(summaryFunc)) {
|
|
return [];
|
|
return [];
|
|
}
|
|
}
|