首页 > 解决方案 > 材质ui表,单元格编辑日期验证

问题描述

我正在使用材料表https://github.com/mbrn/material-table,我的问题是

编辑单元格时如何验证日期[活动-非活动]?

我的代码:

{ title: 'Active', field: 'active', type: "date"},
{ title: 'Inactive', field: 'inactive', type: "date",
            editComponent: props => (
              <input 
                type="date"
                value={props.value}
                onChange={e => props.onChange(e.target.value)}
                min={props.rowData.active}
                InputProps={{inputProps: {min: props.rowData.active}}}
            />)},

我正在使用此代码但不起作用,仍然允许我在活动之前选择非活动日期。我放了 min(active),有人知道如何解决这个问题吗?谢谢

标签: javascriptreactjsdatematerial-ui

解决方案


推荐阅读