需求,在el-table中嵌套select,下拉选择新状态,则自动更新,现在问题是下拉选择后,数据库状态并没更新。
<el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope">
<el-select v-model="scope.row.orderStatus" @change="changeOrderStatus"
>
<el-option v-for="dict in dict.type.shop_order_status" :key="dict.value" :label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
//change监听
changeOrderStatus() {
if (this.form.id != null) {
updateShopOrderStatus(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.getList()
})
}
}
我的解答思路和尝试过的方法
希望达到的效果,在el-table中嵌套select,下拉切换新状态,则自动更新状态