Skip to content

Commit

Permalink
fix(form): table分页lastData初始化异常
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Oct 23, 2023
1 parent 1c516bb commit bd9686d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/form/src/containers/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const modelName = computed(() => props.name || props.config.name || '');
const data = computed(() =>
props.config.pagination
? props.model[modelName.value].filter(
? (props.model[modelName.value] || []).filter(
(item: any, index: number) =>
index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value,
)
Expand All @@ -258,11 +258,11 @@ const data = computed(() =>
const lastData = computed(() =>
props.config.pagination
? props.lastValues[modelName.value].filter(
? (props.lastValues[modelName.value] || []).filter(
(item: any, index: number) =>
index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value,
)
: props.lastValues[modelName.value] || {},
: props.lastValues[modelName.value] || [],
);
const sortChange = ({ prop, order }: SortProp) => {
Expand Down

0 comments on commit bd9686d

Please sign in to comment.