In component1.vue, the code looks like this:
export default {
data () {
return {
editItemNumber: null,
editBreakdownNumber: null
}
}
Meanwhile, in component2.vue, there is a table that is filled with an array of items.
Within that table, there is an edit button. Each row in the table has an itemNumber value, which needs to be assigned to the editItemNumber in component1.vue when that particular row is clicked.
<b-table show-empty bordered striped hover :items="itemTableList" :fields="fields">
<template slot="actions" scope="row">
<b-btn variant='success' size="sm" @click.stop="edit(row.item,row.index,$event.target)">Edit</b-btn>
</template>
</b-table>
Originally, all of this functionality was on one component and I simply called an edit function that repopulated the v-models with the contents of the selected row. But now that everything is split among components, I am unsure how to modify it to achieve my current task.
I have limited experience with JavaScript, Vue, and web development in general. As a .NET developer who has been asked to assist with web projects, I am struggling to adapt. Any guidance would be greatly appreciated.