要说的就这么多
1 2 3 4 5 6 7 8 9 10 11 12
| <el-table ...> ... <el-table-column ...> <template scope="scope"> <div> <el-input-number v-model="scope.row.quantity" @change="(value) => handleInput(value, scope.row.quantity)" ...> </el-input-number> </div> </template> </el-table-colum> ... </el-table>
|
1 2 3 4
| handleInput (value, quantity) { console.log(value) console.log(quantity) },
|
直接这样就没事
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <el-table ...> ... <el-table-column ...> <template scope="scope"> <div> <el-input v-model="scope.row.quantity" @change="handleInput(scope.row)" class="count-input" onkeypress="return event.keyCode>=48&&event.keyCode<=57"> <el-button slot="prepend" @click="del(scope.row)"><i class="el-icon-minus"></i></el-button> <el-button slot="append" @click="add(scope.row)"><i class="el-icon-plus"></i></el-button> </el-input> </div> </template> </el-table-colum> ... </el-table>
|
-
Next Post
JS语句执行顺序的研究
-
Previous Post
神志不清写下的代码