screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h2>Vue js Formatted Date MM/DD/YYYY</h2> <p>Formatted Date: {{ formattedDate }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { formattedDate: "", }; }, mounted() { const date = new Date(); // Current date this.formattedDate = date.toLocaleDateString("en-US", { month: "2-digit", day: "2-digit", year: "numeric", }); }, }); </script> <style> #app { margin: 0 auto; width: 600px; text-align: center; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.24); padding: 20px; } </style> </body> </html>