index.js 778 B

123456789101112131415161718192021222324
  1. import { ElRate } from 'element-plus'
  2. import { useFormInput } from '@cip/components/hooks/form-input'
  3. import { formInputProps } from '../../form-input-props'
  4. import { useRateConfig } from './use-rate-config'
  5. import './index.less'
  6. export default {
  7. props: formInputProps,
  8. emits: ['update:modelValue'],
  9. setup (props, context) {
  10. const formInput = useFormInput(props, context)
  11. const { proxyValue, securityConfig } = formInput
  12. const { allowHalf, max } = useRateConfig(formInput)
  13. return () => <div class={'cip-rate'}>
  14. <ElRate
  15. v-model={proxyValue.value}
  16. allowHalf={allowHalf.value}
  17. disabled={props.disabled}
  18. max={max.value}
  19. showScore={securityConfig.value.showScore}
  20. />
  21. </div>
  22. }
  23. }