xm-slider.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div>
  3. <a-form-model-item label="范围">
  4. <SdRangeInput
  5. :min.sync="component.attr.minValue"
  6. :max.sync="component.attr.maxValue"
  7. @change="component.key = component.key + 1"
  8. />
  9. </a-form-model-item>
  10. <a-form-model-item label="默认值">
  11. <a-input-number
  12. v-model="component.attr.defaultValue"
  13. @change="component.key = component.key + 1"
  14. />
  15. </a-form-model-item>
  16. </div>
  17. </template>
  18. <script>
  19. import { Slider } from 'ant-design-vue'
  20. import SdRangeInput from '@/form-designer/sd-range-input.vue'
  21. import components from './_import-components/xm-slider-import'
  22. export const metaInfo = {
  23. caption: '滑块',
  24. component: {
  25. props: ['designerData'],
  26. render() {
  27. return (
  28. <Slider
  29. vModel={this.designerData.attr.defaultValue}
  30. key={this.designerData.key}
  31. min={Number(this.designerData.attr.minValue)}
  32. max={Number(this.designerData.attr.maxValue)}
  33. />
  34. )
  35. },
  36. },
  37. icon: 'sliders',
  38. order: 500,
  39. }
  40. export const fieldProps = {
  41. dataType: 'number',
  42. attr: {
  43. minValue: 0,
  44. maxValue: 10,
  45. },
  46. attrFD: { formItemProps: { inputProps: {} } },
  47. key: 1,
  48. }
  49. export default {
  50. name: 'XmSlider',
  51. components: { SdRangeInput, ...components },
  52. data() {
  53. return {}
  54. },
  55. }
  56. </script>
  57. <style module lang="scss">
  58. @use '@/common/design' as *;
  59. </style>