0

This answer shows how to call two functions with v-on by doing v-on:click="firstFunction(); secondFunction();". But in my project, I need to call a function besides an expression imposed by Vuetify. The default Vuetify code is:

<v-btn color="success" @click="dialog = false">
  Save Row
</v-btn>

However beside the expression dialog = false, I need to call a certain function newRow(). I tried:

 <v-btn color="success" @click="newRow(); dialog = false">
    Save Row
</v-btn>

But that breaks the Vuetify functionality (the dialog doesn't close anymore). Any suggestion?

1 Answer 1

1

Inside your newRow() method add :

      methods:{
          newRow(){
           //here put the logic to add new row 
           //and after that close the dialog box
           this.dialog=false;
           }
      ...
     }

and call it in the template like :

  <v-btn color="success" @click="newRow()">
    Save Row
  </v-btn>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.