screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js String toUpperCase Method </h2> <button @click="myFunction">click me</button> <p>Convert string to Upper case in Vue Js</p> <p>Text:{{text}}</p> <p>First letter Captital: {{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ text:'fontawesomeicons', firstLetter:'', restLetter:'', results:'' } }, methods:{ myFunction(){ this.firstLetter = this.text.charAt().toUpperCase(); this.restLetter = this.text.slice(1); this.results = this.firstLetter.concat(this.restLetter) }, } }).mount('#app') </script> </body> </head> </html>