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 getDay Method </h2> <p>Get Day of the Week in Vue Js </p> <input @input='myFunction' type="date" v-model="day"/> <p>Day: {{dayString}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ day:'', weekday:['Sunday','Monday','Tuesday','Wednesday','Thrusady','Friday','Saturday'], dayNumber:'', dayString:'' } }, methods:{ myFunction(){ const d = new Date(this.day); this.dayNumber = d.getDay(); this.dayString = this.weekday[this.dayNumber] } } }).mount('#app') </script> </body> </head> </html>