koel/resources/assets/js/components/ui/form/TextInput.vue

28 lines
671 B
Vue
Raw Normal View History

2024-04-04 22:20:42 +00:00
<template>
<input
ref="el"
v-model="value"
2024-04-19 18:10:55 +00:00
class="block text-base w-full px-4 py-2.5 rounded bg-k-bg-input text-k-text-input
2024-04-04 22:20:42 +00:00
read-only:bg-gray-400 read-only:text-gray-900 disabled:bg-gray-400 disabled:text-gray-900"
type="text"
>
</template>
2024-04-23 21:01:27 +00:00
<script lang="ts" setup>
2024-04-04 22:20:42 +00:00
import { computed, ref } from 'vue'
const props = withDefaults(defineProps<{ modelValue?: any }>(), { modelValue: null })
const emit = defineEmits<{ (e: 'update:modelValue', value: any): void }>()
const value = computed({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
2024-04-04 22:20:42 +00:00
})
const el = ref<HTMLInputElement>()
defineExpose({
el,
2024-04-04 22:20:42 +00:00
})
</script>