Skip to content

Commit e80280f

Browse files
authored
feat(form): add Slider demo (#555)
* feat(function): add 增加Slider滑动输入条组件 * feat(function): add 增加Slider滑动输入条组件demo * feat(function): add 增加Slider滑动输入条组件demo
1 parent f4c9703 commit e80280f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/components/Form/src/componentMap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
Switch,
1717
TimePicker,
1818
TreeSelect,
19+
Slider
1920
} from 'ant-design-vue';
2021

2122
import RadioButtonGroup from './components/RadioButtonGroup.vue';
@@ -44,6 +45,7 @@ componentMap.set('RadioGroup', Radio.Group);
4445
componentMap.set('Checkbox', Checkbox);
4546
componentMap.set('CheckboxGroup', Checkbox.Group);
4647
componentMap.set('Cascader', Cascader);
48+
componentMap.set('Slider', Slider);
4749

4850
componentMap.set('DatePicker', DatePicker);
4951
componentMap.set('MonthPicker', DatePicker.MonthPicker);

src/components/Form/src/types/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,5 @@ export type ComponentType =
108108
| 'StrengthMeter'
109109
| 'Upload'
110110
| 'IconPicker'
111-
| 'Render';
111+
| 'Render'
112+
| 'Slider';

src/views/demo/form/index.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,23 @@
333333
placeholder: '省份与城市联动',
334334
},
335335
},
336+
{
337+
field: 'field21',
338+
component: 'Slider',
339+
label: '字段21',
340+
componentProps: {
341+
min: 0,
342+
max: 100,
343+
range: true,
344+
marks: {
345+
20: '20°C',
346+
60: '60°C',
347+
},
348+
},
349+
colProps: {
350+
span: 8,
351+
},
352+
},
336353
];
337354
338355
export default defineComponent({

0 commit comments

Comments
 (0)