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"> <h3>Vue Js Display date time of document when last modified/updated</h3> <input v-model="myDataProperty" @input="updateLastModified()"> <p>Last modified: {{ lastModified }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { myDataProperty: '', lastModified: null, }; }, methods: { updateLastModified() { this.lastModified = new Date().toLocaleString(); } }, mounted() { this.lastModified = new Date(document.lastModified).toLocaleString(); }, }) </script> <style scoped> #app { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background-color: #f8f8f8; padding: 20px; font-family: 'Helvetica Neue', sans-serif; } input { padding: 12px 16px; font-size: 18px; border: none; border-radius: 6px; box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2); margin-bottom: 16px; width: 100%; background-color: #fff; transition: all 0.3s ease-in-out; } input:focus { outline: none; box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4), 0px 0px 8px rgba(0, 0, 0, 0.1); } p { font-size: 14px; color: #555; margin-top: 16px; } </style> </body> </html>