screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js Disable button if input empty </h3> <input v-model="text" type="text" /> <button :disabled="!text">Submit</button> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { text: '' } }, }); </script> <style scoped> #app { margin: 20px; font-family: Arial, sans-serif; } h3 { font-size: 1.5em; font-weight: bold; margin-bottom: 10px; } input[type="text"] { padding: 5px; font-size: 1em; border: 1px solid #ccc; border-radius: 5px; margin-right: 10px; } button { padding: 5px 10px; font-size: 1em; border: none; border-radius: 5px; background-color: #007bff; color: #fff; cursor: pointer; } button:disabled { opacity: 0.5; cursor: not-allowed; } </style> </body> </html>