screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <h2>Vue Delay for 1 Seconds </h2> <div id="app"> <button @click="startDelayedAction">Start Delayed Action</button> <p>{{ result }}</p> </div> <script type="module"> const app = Vue.createApp({ data() { return { result: "", } }, methods: { startDelayedAction() { this.result = "Loading..."; setTimeout(() => { this.performAction(); }, 1000); }, performAction() { this.result = "Action performed!"; }, }, }); app.mount("#app"); </script> </body> </html>