mobile.jsx 729 B

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