screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <h2>Vue js check if string is all uppercase </h2> <div id="app" class="login-container"> <input v-model="myString" @input="checkUpperCase"> <div v-if="myString"> <p v-if="isUpperCase" style='color:green'>The string is all uppercase.</p> <p v-else style="color:red">The string is not all uppercase.</p> </div> </div> <script type="module"> const app = Vue.createApp({ data() { return { myString: '', isUpperCase: false } }, methods: { checkUpperCase() { if (this.myString === this.myString.toUpperCase()) { this.isUpperCase = true; } else { this.isUpperCase = false; } } } });app.mount("#app"); </script> </body> </html>