1
<td> //here i need click button
  <v-btn icon v-for="bank in order.banks" :key="bank.bankIndex">{{bank.tittle}}</v-btn>
</td>


<td> // here it is necessary that only one price of clicked bank appears
  <div v-for="bank in order.banks" :key="bank.value">
    {{bank.currency}} {{bank.value}}
  </div>
</td>

here is part of my code. what i want: when click on the left button there on right side of table will change information. i thought i can do this through data() and v-model just create one object and write inside information about click BUT i have a table with 100+ items and every item need same function.

1
  • You say you tried something and it didn't worked. Show the code!! Commented Oct 10, 2020 at 20:55

1 Answer 1

3

The way to do that is to create a function that will be triggered on button click.

<v-btn icon v-for="bank in order.banks" :key="bank.bankIndex" @click="setNewData(bank)">{{bank.tittle}}</v-btn>
methods: {
  setNewData(bank) {
    // make your changes here...
  }
}
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.