mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-02 19:08:40 +08:00
fix(form): fix form inputNumber verification error
This commit is contained in:
parent
abb0cfae06
commit
4ddee05dee
@ -9,6 +9,10 @@
|
||||
|
||||
- 更新 antdv 到`2.0.0-rc.1`
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
- 修复表单 inputNumber 校验错误
|
||||
|
||||
## 2.0.0-rc.10 (2020-11-13)
|
||||
|
||||
### ✨ Refactor
|
||||
|
@ -122,10 +122,10 @@ export default defineComponent({
|
||||
} = props.schema;
|
||||
|
||||
if (isFunction(dynamicRules)) {
|
||||
return dynamicRules(unref(getValuesRef));
|
||||
return dynamicRules(unref(getValuesRef)) as ValidationRule[];
|
||||
}
|
||||
|
||||
let rules: ValidationRule[] = cloneDeep(defRules);
|
||||
let rules: ValidationRule[] = cloneDeep(defRules) as ValidationRule[];
|
||||
|
||||
if ((!rules || rules.length === 0) && required) {
|
||||
rules = [{ required }];
|
||||
@ -157,6 +157,9 @@ export default defineComponent({
|
||||
if (component.includes('RangePicker')) {
|
||||
rule.type = 'array';
|
||||
}
|
||||
if (component.includes('InputNumber')) {
|
||||
rule.type = 'number';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import type { ModalFunc, ModalFuncProps } from 'ant-design-vue/lib/modal/Modal';
|
||||
import type { MessageApi } from 'ant-design-vue/lib/message';
|
||||
|
||||
import { Modal, message as Message, notification } from 'ant-design-vue';
|
||||
import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons-vue';
|
||||
@ -100,7 +99,7 @@ notification.config({
|
||||
*/
|
||||
export function useMessage() {
|
||||
return {
|
||||
createMessage: Message as MessageApi,
|
||||
createMessage: Message,
|
||||
notification: notification as NotifyApi,
|
||||
createConfirm: createConfirm,
|
||||
createSuccessModal,
|
||||
|
@ -208,6 +208,15 @@
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'field20',
|
||||
component: 'InputNumber',
|
||||
label: '字段20',
|
||||
required: true,
|
||||
colProps: {
|
||||
span: 8,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default defineComponent({
|
||||
|
Loading…
Reference in New Issue
Block a user