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 Math.abs() Method </h2> <p>convert a negative number to a positive number on input in Vue.js</p> <input type="number" @input="myFunction" v-model="integer"/> <p> Number: {{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ integer:'', result:'', } }, methods:{ myFunction(){ this.result = (Math.abs(this.integer)) } } }).mount('#app') </script> </body> </head> </html>