@@ -3,7 +3,7 @@ import type { PaginationProps } from '../types/pagination';
33import type { DynamicProps } from '/@/types/utils' ;
44import { getDynamicProps } from '/@/utils' ;
55
6- import { ref , onUnmounted , unref , watch } from 'vue' ;
6+ import { ref , onUnmounted , unref , watch , toRaw } from 'vue' ;
77import { isProdMode } from '/@/utils/env' ;
88import { isInSetup } from '/@/utils/helper/vueHelper' ;
99import { error } from '/@/utils/log' ;
@@ -77,11 +77,11 @@ export function useTable(
7777 getTableInstance ( ) . setLoading ( loading ) ;
7878 } ,
7979 getDataSource : ( ) => {
80- return getTableInstance ( ) . getDataSource ( ) ;
80+ return toRaw ( getTableInstance ( ) . getDataSource ( ) ) ;
8181 } ,
8282 getColumns : ( { ignoreIndex = false } : { ignoreIndex ?: boolean } = { } ) => {
8383 const columns = getTableInstance ( ) . getColumns ( { ignoreIndex } ) || [ ] ;
84- return columns ;
84+ return toRaw ( columns ) ;
8585 } ,
8686 setColumns : ( columns : BasicColumn [ ] ) => {
8787 getTableInstance ( ) . setColumns ( columns ) ;
@@ -96,10 +96,10 @@ export function useTable(
9696 getTableInstance ( ) . deleteSelectRowByKey ( key ) ;
9797 } ,
9898 getSelectRowKeys : ( ) => {
99- return getTableInstance ( ) . getSelectRowKeys ( ) ;
99+ return toRaw ( getTableInstance ( ) . getSelectRowKeys ( ) ) ;
100100 } ,
101101 getSelectRows : ( ) => {
102- return getTableInstance ( ) . getSelectRows ( ) ;
102+ return toRaw ( getTableInstance ( ) . getSelectRows ( ) ) ;
103103 } ,
104104 clearSelectedRowKeys : ( ) => {
105105 getTableInstance ( ) . clearSelectedRowKeys ( ) ;
@@ -111,16 +111,16 @@ export function useTable(
111111 return getTableInstance ( ) . getPaginationRef ( ) ;
112112 } ,
113113 getSize : ( ) => {
114- return getTableInstance ( ) . getSize ( ) ;
114+ return toRaw ( getTableInstance ( ) . getSize ( ) ) ;
115115 } ,
116116 updateTableData : ( index : number , key : string , value : any ) => {
117117 return getTableInstance ( ) . updateTableData ( index , key , value ) ;
118118 } ,
119119 getRowSelection : ( ) => {
120- return getTableInstance ( ) . getRowSelection ( ) ;
120+ return toRaw ( getTableInstance ( ) . getRowSelection ( ) ) ;
121121 } ,
122122 getCacheColumns : ( ) => {
123- return getTableInstance ( ) . getCacheColumns ( ) ;
123+ return toRaw ( getTableInstance ( ) . getCacheColumns ( ) ) ;
124124 } ,
125125 getForm : ( ) => {
126126 return ( unref ( formRef ) as unknown ) as FormActionType ;
@@ -129,7 +129,7 @@ export function useTable(
129129 getTableInstance ( ) . setShowPagination ( show ) ;
130130 } ,
131131 getShowPagination : ( ) => {
132- return getTableInstance ( ) . getShowPagination ( ) ;
132+ return toRaw ( getTableInstance ( ) . getShowPagination ( ) ) ;
133133 } ,
134134 } ;
135135
0 commit comments