We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题已解决,写出来当个思路给后来人看看,有权限大佬看到翻转下状态 需求:当 select选中为'3'时,展示input框,输入数据保存 问题:切换为input后,输入除了‘3’,任何值都会将状态赋值给constant.comPanyType,导致input框消失,一直没找到原因 解决方案: input内的onChange事件阻止冒泡e.stopPopagition即可解决,并利用setRowData将值保存到inputVal
const options = [ { value: '1', label: '股份有限公司' }, { value: '2', label: '私有公司' }, { value: '3', label: '其他' } ]
const handleSelect = (val: any, constant: any) => { ref?.current?.setRowData(constant.recordKey, { comPanyType: val }) }
const columns = [ { title: '公司类型', dataIndex: 'companyType', width: '15%', renderFormItem: (_: any, constant: any) => { const { record: { companyType, inputVal = '' } // 本身没有inputVal,期望用来存input的数据 } = constant return (
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题已解决,写出来当个思路给后来人看看,有权限大佬看到翻转下状态
需求:当 select选中为'3'时,展示input框,输入数据保存
问题:切换为input后,输入除了‘3’,任何值都会将状态赋值给constant.comPanyType,导致input框消失,一直没找到原因
解决方案: input内的onChange事件阻止冒泡e.stopPopagition即可解决,并利用setRowData将值保存到inputVal
const options = [
{ value: '1', label: '股份有限公司' },
{ value: '2', label: '私有公司' },
{ value: '3', label: '其他' }
]
const handleSelect = (val: any, constant: any) => {
ref?.current?.setRowData(constant.recordKey, { comPanyType: val })
}
const columns = [
{
title: '公司类型',
dataIndex: 'companyType',
width: '15%',
renderFormItem: (_: any, constant: any) => {
const {
record: { companyType, inputVal = '' } // 本身没有inputVal,期望用来存input的数据
} = constant
return (
<Select
option={options}
onSelect={(val) => {
handleSelect(val, constant)
}}
showSearch={false}
/>
{companyType === '3' && }
)
}
}
]
The text was updated successfully, but these errors were encountered: