PHP Classes

File: resources/js/Components/TextInput.vue

Recommend this page to a friend!
  Classes of Rodrigo Faustino   Vue.js PHP CRUD Example Using Laravel Vite   resources/js/Components/TextInput.vue   Download  
File: resources/js/Components/TextInput.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Vue.js PHP CRUD Example Using Laravel Vite
Example application to manage users and blog posts
Author: By
Last change:
Date: 5 months ago
Size: 570 bytes
 

Contents

Class file image Download
<script setup> import { onMounted, ref } from 'vue'; defineProps(['modelValue']); defineEmits(['update:modelValue']); const input = ref(null); onMounted(() => { if (input.value.hasAttribute('autofocus')) { input.value.focus(); } }); defineExpose({ focus: () => input.value.focus() }); </script> <template> <input class="border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" ref="input" /> </template>