0

I am using vuejsbootrap's . I want to edit or delete single record at a time.

<b-table :items="products" :fields="fields">
  <template slot="actions" slot-scope="row">
    <a @click='editRecord()'><font-awesome-icon icon="edit" /></a> | 
    <a @click='deleteRecord()'><font-awesome-icon icon="trash-alt" 
    /></a>
  </template>
</b-table>

i am calling editRecord and deleteRecord but i am unable to pass current record object or id to method.

1 Answer 1

1

Use the row variable from the slot scope:

<template slot="actions" slot-scope="row">
  <a @click='editRecord(row)'><font-awesome-icon icon="edit" /></a> | 
  <a @click='deleteRecord(row)'><font-awesome-icon icon="trash-alt"/></a>
</template>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank U very much. Now i am understanding vuejs little bit.

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.