有没有类似的方式使用引导VUE时传递卡数据,如rowData?
我使用这个功能来卡数据提交到状态,它似乎并没有工作。 我使用类似的方法来传递rowData并能正常工作。
卡数据
行动...
setCard: function ({commit}, cardData) {
commit('setCardToState', cardData)
}
突变...
setCardToState (state, cardData) {
state.addeditinitiative.name = cardData.name
state.addeditinitiative.description = cardData.description
state.addeditinitiative.id = cardData.id
},
模板
<b-card v-for="initiative in initiatives" v-b-modal.NewInitiativeModal @click="setCard">
{{initiative.name}}
</b-card>
行数据
模板
<b-table striped
hover
responsive
:items="products"
:fields="fields"
:filter="reportFilter"
:current-page="currentPage"
:per-page="10"
v-b-modal.EditProductModal
@row-clicked="setRow"></b-table>
</b-row>
行动
setRow: function ({commit}, rowData) {
commit('setRowToState', rowData)
},
突变
setRowToState (state, rowData) {
state.addeditproduct.name = rowData.name
state.addeditproduct.productline = rowData.productline
state.addeditproduct.description = rowData.description
state.addeditproduct.externalid = rowData.externalid
state.addeditproduct.active = rowData.active
state.addeditproduct.id = rowData.id
},