表单验证,数字验证通不过
开发环境、2.1.1
const rules: Partial<Record<string, FormItemRule[]>> = reactive({
community_name: [buildValidatorData({ name: 'required', title: t('room.community_name') })],
address: [buildValidatorData({ name: 'required', title: t('room.address') })],
property_no: [buildValidatorData({ name: 'required', title: t('room.property_no') })],
apartment_name: [buildValidatorData({ name: 'required', title: t('room.apartment_name') })],
apartment_layout: [buildValidatorData({ name: 'required', title: t('room.apartment_layout') })],
apartment_area: [buildValidatorData({ name: 'float', title: t('room.apartment_area') })],
room_name: [buildValidatorData({ name: 'required', title: t('room.room_name') })],
room_area: [buildValidatorData({ name: 'float', title: t('room.room_area') })],
available_date: [buildValidatorData({ name: 'date', title: t('room.available_date') })],
expire_date: [buildValidatorData({ name: 'date', title: t('room.expire_date') })],
create_time: [buildValidatorData({ name: 'date', title: t('room.create_time') })],
update_time: [buildValidatorData({ name: 'date', title: t('room.update_time') })],
})
不知道为什么通不过?
改一改数字是可以通过验证,直接保存会提示,但编辑一般不修改
目前看数据库设置了decimal会出现这个问题,改成float没有了。这个验证好像很奇怪,而且小数点后面0没法录入。
是否跟踪一下, 可能跟精度有关
element的问题
https://github.com/build-admin/buildadmin/issues/36https://github.com/build-admin/buildadmin/issues/36
- 1
前往