Commit 4f874244 authored by 卢均锐's avatar 卢均锐

feat: NiceForm/Search 增加只输入整数控制

parent cb7ffa5d
......@@ -19,6 +19,7 @@ const Search = props => {
align,
advanced = true, // 是否展示高级筛选
tip, // 搜索框悬浮提示
onlyNumber = false, //只输入整数
...rest
} = props.props['x-component-props'];
const justifyAlign = align || 'flex-end';
......@@ -39,7 +40,7 @@ const Search = props => {
<Tooltip title={tip}>
<Input.Search
value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)}
onChange={e => props.mutators.change(onlyNumber ? e.target.value.replace(/\D/g,'') : e.target.value)}
onSearch={(_, e) => {
e.preventDefault();
props.form.submit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment