mobile.jsx 775 B

12345678910111213141516171819202122
  1. import { computed } from 'vue'
  2. import { useFormInput } from '../../../hooks/form-input'
  3. import { formInputProps, fromInputEmits } from '../../form-input-props'
  4. export default {
  5. props: formInputProps,
  6. emits: [...fromInputEmits],
  7. setup (props, context) {
  8. const { width } = useFormInput(props, context)
  9. const fontWeight = computed(() => {
  10. return props.config.fontWeight ?? 'normal'
  11. })
  12. const fontSize = computed(() => {
  13. return props.config.fontSize + 'px' ?? '12px'
  14. })
  15. const textAlign = computed(() => {
  16. return props.config.textAlign ?? 'left'
  17. })
  18. return () => <div style={{ width: width.value, fontWeight: fontWeight.value, fontSize: fontSize.value, textAlign: textAlign.value }}>
  19. {props.modelValue}
  20. </div>
  21. }
  22. }