screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js datepicker change event</h3> <input type="date" v-model="selectedDate" @change="handleDateChange" /> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { selectedDate: null }; }, methods: { handleDateChange(event) { // Access the selected date from the event object const selectedDate = event.target.value; // Do something with the selected date console.log("Selected date:", selectedDate); } } }); </script> <style scoped> #app { max-width: 400px; margin: 0 auto; padding: 20px; } h3 { margin-bottom: 10px; } input[type="date"] { display: block; width: 100%; padding: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; box-sizing: border-box; transition: border-color 0.3s ease-in-out; } input[type="date"]:focus { outline: none; border-color: #007bff; box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); } </style> </body> </html>