diff --git a/src/components/seal-table/components/seal-column.tsx b/src/components/seal-table/components/seal-column.tsx index 2f154fff..6eec250e 100644 --- a/src/components/seal-table/components/seal-column.tsx +++ b/src/components/seal-table/components/seal-column.tsx @@ -10,7 +10,7 @@ import { SealColumnProps } from '../types'; const SealColumn: React.FC = (props) => { const intl = useIntl(); const { row, onCell } = useContext(RowContext); - const { dataIndex, render, align, editable, valueType, title } = props; + const { dataIndex, render, align, editable } = props; const [isEditing, setIsEditing] = React.useState(false); const [current, setCurrent] = React.useState(row[dataIndex]); const cachedValue = React.useRef(row[dataIndex]); @@ -38,9 +38,11 @@ const SealColumn: React.FC = (props) => { const renderContent = () => { if (isEditing && editable) { - return valueType === 'number' ? ( + const isNumType = + typeof editable === 'object' && editable.valueType === 'number'; + return isNumType ? ( { @@ -72,7 +74,7 @@ const SealColumn: React.FC = (props) => { {renderContent()} {editable && ( - + {isEditing ? ( <> = (props) => { ) : ( - - {intl.formatMessage({ id: 'common.button.edit' })} - {title} - - } - > + {editable?.title}}>