screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> </head> <body> <div id="app"> <h3>Vue Js Show Remaining Characters</h3> <label>Input field:</label><br><br> <textarea v-model="inputValue" :maxlength="maxLength"></textarea> <div>Remaining characters: {{ remainingChars }}</div> </div> <script type="module"> import { createApp } from "vue"; createApp({ data() { return { inputValue: '', maxLength: 10 } }, computed: { remainingChars() { return this.maxLength - this.inputValue.length }, } }).mount("#app"); </script> </body> </html>