screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3.2.22/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue Js Call Multiple Functions in onClick Event</h3> <button @click="firstMethod(); secondMethod()">Click me</button> <small>{{result1}}</small> <small>{{result2}}</small> </div> <script type="module"> const app = Vue.createApp({ data() { return { resutl1: '', result2: '' } }, methods: { firstMethod() { this.result1 = "First method called"; }, secondMethod() { this.result2 = "Second method called"; }, }, }) app.mount('#app') </script> <style scoped> #app { background-color: #f8f8f8; padding: 20px; border: 1px solid #ddd; } h3 { color: #333; font-size: 24px; margin-bottom: 10px; } button { background-color: #007bff; color: #fff; border: none; padding: 10px 20px; font-size: 18px; border-radius: 5px; cursor: pointer; margin-bottom: 10px; } button:hover { background-color: #0062cc; } small { display: block; margin-top: 10px; font-size: 16px; color: #333; } </style> </body> </html>