0π
β
Iβm assuming youβre using Bootstrap Vue here, the component props look similar.
The b-table
component here, with the row-clicked
event returns three arguments.
- the row data
- index of the row
- the native event object
You need to rewrite your action and mutation to use that row data returned with the event and update the state. Code follows.
Action:
setRow: function ({commit}, rowData) {
commit('setRowToState', rowData)
}
Mutation:
setRowToState (state, rowData) {
state.addeditproduct.name = rowData.name
state.addeditproduct.description = rowData.description
state.addeditproduct.externalid = rowData.externalid
state.addeditproduct.active = rowData.active
state.addeditproduct.id = rowData.id
},
π€Nishant Arora
Source:stackexchange.com