import { defineComponent, ref, watch, computed } from 'vue' const input = defineComponent({ name: 'Input', props: { size: { type: String, default: 'medium', validator(value) { return ['small', 'medium', 'large'].includes(value) }, }, type: { type: String, default: 'text', validator(value) { return ['text', 'password', 'textarea'].includes(value) }, }, disabled: { type: Boolean, default: false, validator(value) { return typeof value == 'boolean' }, }, value: [String, Number], placeholder: String, rows: { type: Number, default: 4, }, cols: Number, }, emits: ['update:value'], setup(props, { emit, slots }) { const inputSize = computed(() => { return 'u-input-size-' + props.size }) const isFocus = ref(false) const onFocus = () => { isFocus.value = true } const onBlur = () => { isFocus.value = false } const inputType = computed(() => { return props.type == 'password' ? 'password' : '' }) const onInput = (e) => { emit('update:value', e.target.value) } return () => (