slider test component

This commit is contained in:
swtmply
2023-07-28 12:08:29 +08:00
parent e4890c5fb8
commit 8b4ce18409
3 changed files with 58 additions and 13 deletions

View File

@@ -4,6 +4,18 @@ import React from "react";
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
const { name, label, required, min, max } = formItem;
const marks = {
[min]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
[max / 2]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
[max]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
};
return (
<Form.Item
name={name}
@@ -15,7 +27,12 @@ export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
},
]}
>
<Slider disabled={readOnly} min={min || 0} max={max || 10} />
<Slider
disabled={readOnly}
min={min || 0}
max={max || 10}
marks={marks}
/>
</Form.Item>
);
}