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