Vue 事件的$event参数=事件的值

template

<el-table :data="dataList">
  <el-table-column label="id" prop="id"></el-table-column>
  <el-table-column label="name" prop="name">
    <template v-slot="props">
      <el-input-number
      :min="0"
      v-model="props.row.count"
      @change="updateProduct($event)"
      size="mini"
    ></el-input-number>
    </template>
  </el-table-column>
</el-table>

Script 部分

export default {
  data() {
    return {
      dataList: [
        { id: 1, name: '001', count: 1 },
        { id: 2, name: '002', count: 2 },
        { id: 3, name: '003', count: 3 },
      ]
    }
  },
  methods: {
    updateProduct(value) {
      console.info(value)
    }
  }
}
posted @ 2020-08-04 14:54  荣光无限  阅读(5631)  评论(0编辑  收藏  举报