screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> </head> <body> <div id="app"> <h3>Vue js Scroll to Bottom of Page</h3> <p>Click the button to scroll to the bottom of the page smoothly.</p> <button @click="scrollBottom">Scroll to Bottom</button> </div> <script type="module"> import { createApp } from "vue"; createApp({ data() { return { bottom: '' } }, methods: { scrollBottom() { this.bottom = document.body.scrollHeight; window.scrollTo({ top: this.bottom, behavior: 'smooth' }); } } }).mount("#app"); </script> <style scoped> body { height: 5000px; margin: 0; font-family: Arial, sans-serif; } #app { padding: 20px; } button { position: fixed; bottom: 20px; right: 20px; padding: 10px 20px; font-size: 16px; background-color: #007bff; color: #fff; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #0056b3; } </style> </body> </html>