close

How to call multiple functions with @click in vue?

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to call multiple functions with @click in vue? in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

How to call multiple functions with @click in vue ?

  1. How to call multiple functions with @click in vue ?

    to call multiple functions with @click in vue On Vue 2.3 and above you can do this:
    <div v-on:click="firstFunction(); secondFunction();"></div> // or <div @click="firstFunction(); secondFunction();"></div>

  2. How to call multiple functions with @click in vue ?

    to call multiple functions with @click in vue On Vue 2.3 and above you can do this:
    <div v-on:click="firstFunction(); secondFunction();"></div> // or <div @click="firstFunction(); secondFunction();"></div>

Method 1

On Vue 2.3 and above you can do this:

<div v-on:click="firstFunction(); secondFunction();"></div>
// or
<div @click="firstFunction(); secondFunction();"></div>

Method 2


If you want something a little bit more readable, you can try this:

<button @click="[click1($event), click2($event)]">
  Multiple
</button>

To me, this solution feels more Vue-like hope you enjoy

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment