xm-rate.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div>
  3. <a-form-model-item label="star总数">
  4. <a-input-number v-model="component.attrFD.formItemProps.inputProps.count"></a-input-number>
  5. </a-form-model-item>
  6. <a-form-model-item label="默认值">
  7. <a-input-number
  8. v-model="component.attr.defaultValue"
  9. @change="component.key = component.key + 1"
  10. />
  11. </a-form-model-item>
  12. </div>
  13. </template>
  14. <script>
  15. import { Rate } from 'ant-design-vue'
  16. import components from './_import-components/xm-rate-import'
  17. export const metaInfo = {
  18. caption: '评分',
  19. component: {
  20. props: ['designerData'],
  21. render() {
  22. const { count } = this.designerData.attrFD.formItemProps.inputProps
  23. return (
  24. <Rate
  25. vModel={this.designerData.attr.defaultValue}
  26. count={count || 0}
  27. key={this.designerData.key}
  28. />
  29. )
  30. },
  31. },
  32. icon: 'star',
  33. order: 700,
  34. }
  35. export const fieldProps = {
  36. dataType: 'number',
  37. attrFD: { formItemProps: { inputProps: { count: 5 } } },
  38. key: 1,
  39. }
  40. export default {
  41. name: 'XmRate',
  42. components,
  43. data() {
  44. return {}
  45. },
  46. }
  47. </script>
  48. <style module lang="scss">
  49. @use '@/common/design' as *;
  50. </style>