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 Date Format MMMM DD, YYYY</h2> <p>Formatted Date: {{ formattedDate }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { formattedDate: "", }; }, mounted() { this.formatDate(); }, methods: { formatDate() { const options = { month: "long", day: "numeric", year: "numeric" }; const date = new Date(); this.formattedDate = date.toLocaleDateString(undefined, options); }, }, }); </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>