screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue Js Computed Property</h3> <p>Enter a number:</p> <input type="number" v-model="numberInput"> <p>The square of the number is {{ square }}</p> </div> <script type="module"> const app = Vue.createApp({ data() { return { numberInput: 0 }; }, computed: { square() { return this.numberInput * this.numberInput; } } }); app.mount('#app'); </script> <style scoped> #app { font-family: Arial, sans-serif; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; max-width: 400px; } h3 { font-size: 24px; font-weight: bold; margin-top: 0; } p { font-size: 16px; margin-bottom: 10px; } input { font-size: 16px; padding: 5px; border: 1px solid #ccc; border-radius: 5px; width: 100%; box-sizing: border-box; } </style> </body> </html>