screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue 3 Disable Button onClick Button</h3> <button @click="handleClick" :disabled="isDisabled">Click me</button> </div> <script type="module"> const { createApp, ref } = Vue; createApp({ setup() { const isDisabled = ref(false); function handleClick() { // Your logic to determine whether the button should be disabled or not // For example, disabling the button after it's clicked once isDisabled.value = true; // Your other logic... } return { isDisabled,handleClick }; } }).mount("#app"); </script> <style scoped></style> </body> </html>