/
marklis
/
anticafe-breeze
Обзор
Документация
Войти
/
marklis
/
anticafe-breeze
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
resources/js/Components/TextInput.vue
26 строк
505 B
Мамонов Алексей Анатольевич
Инициализация
06 мар 2025, 17:45
06 мар 2025, 17:45
0f37205
Код
Авторство
О чём код?
<script setup> import { onMounted, ref } from 'vue'; const model = defineModel({ type: String, required: true, }); const input = ref(null); onMounted(() => { if (input.value.hasAttribute('autofocus')) { input.value.focus(); } }); defineExpose({ focus: () => input.value.focus() }); </script> <template> <input class="rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" v-model="model" ref="input" /> </template>