fix: dateFormatter2在vscode中爆红的问题

1. 下划线开始的变量可以避免提示变量未使用
2. 比较奇怪,dateFormatter在vscode上不会爆红,dateFormatter2会。都加上类型定义吧


Signed-off-by: dhb52 <dhb52@126.com>
pull/390/head
dhb52 2024-02-21 15:39:07 +00:00 committed by Gitee
parent f5b8d92d97
commit b127aabc87
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import dayjs from 'dayjs'
import type { TableColumnCtx } from 'element-plus'
/**
* el-date-picker
@ -199,8 +200,7 @@ export function formatPast2(ms) {
* @param column
* @param cellValue
*/
// @ts-ignore
export const dateFormatter = (row, column, cellValue): string => {
export const dateFormatter = (_row: any, _column: TableColumnCtx<any>, cellValue: any): string => {
if (!cellValue) {
return ''
}
@ -214,10 +214,9 @@ export const dateFormatter = (row, column, cellValue): string => {
* @param column
* @param cellValue
*/
// @ts-ignore
export const dateFormatter2 = (row, column, cellValue) => {
export const dateFormatter2 = (_row: any, _column: TableColumnCtx<any>, cellValue: any): string => {
if (!cellValue) {
return
return ''
}
return formatDate(cellValue, 'YYYY-MM-DD')
}