screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script> </head> <body> <div id="app"> <h3>Vue Js get current timestamp</h3> <p>Current Timestamp: {{ currentTimestamp }}</p> <button @click="reload">Reload</button> </div> <script> new Vue({ el: "#app", data() { return { currentTimestamp: null, }; }, mounted() { this.getCurrentTimestamp(); }, methods: { getCurrentTimestamp() { this.currentTimestamp = Date.now(); }, reload() { window.parent.location.reload(); }, }, }); </script> <style> /* Additional styles */ #app { max-width: 800px; margin: 0 auto; padding: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } h3 { font-size: 24px; margin-bottom: 10px; color: #333; } p { font-size: 18px; color: #666; } button { padding: 10px 20px; background-color: #4caf50; color: #fff; border: none; border-radius: 4px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; } button:hover { background-color: #45a049; } </style> </body> </html>