screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue 3 Get Current Date</h3> <p>Current Date: {{ currentDate }}</p> </div> <script type="module"> const { createApp, ref, onMounted } = Vue; createApp({ setup() { const currentDate = ref(''); onMounted(() => { getCurrentDate(); }); function getCurrentDate() { const date = new Date(); currentDate.value = date.toDateString(); } return { currentDate }; } }).mount("#app"); </script> </body> </html>