File tree Expand file tree Collapse file tree
packages/vtable-plugins/src/table-export/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export type ExportVTableToExcelOptions = {
4141
4242export type ExportVTableToCsvOptions = {
4343 formatExportOutput ?: (cellInfo : CellInfo ) => string | undefined ;
44- escape ?: boolean ;
44+ escape ?: boolean ; // Whether to escape special symbols in strings to avoid interfering with CSV parsing, default true
4545 exportAllData ?: boolean ;
4646 downloadFile ?: boolean ;
4747 fileName ?: string ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export type ExportVTableToExcelOptions = {
4141
4242export type ExportVTableToCsvOptions = {
4343 formatExportOutput ?: (cellInfo : CellInfo ) => string | undefined ;
44- escape ?: boolean ;
44+ escape ?: boolean ; // 是否需要将字符串中的特殊符号进行转义,以避免干扰CSV解析,默认为true
4545 exportAllData ?: boolean ;
4646 downloadFile ?: boolean ;
4747 fileName ?: string ;
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ function getCopyCellValue(
8181 }
8282
8383 let value = cellValue ;
84- if ( option ?. escape ) {
84+ if ( option ?. escape !== false ) {
85+ //escape默认逻辑改为true,进行转义
8586 value = escapeForCSV ( value ) ;
8687 } else if ( typeof value === 'string' ) {
8788 value = '"' + value + '"' ;
You can’t perform that action at this time.
0 commit comments