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.length property </h2> <p> On input, the programme should count the length of the string by calculating the number of characters contained in it </p> <input @input="myFunction" type="text" v-model="string"/> <p>Number of character: {{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ string : '', results:'' } }, methods:{ myFunction(){ this.results = this.string.length; }, } }).mount('#app') </script> </body> </head> </html>