vue 中 的复选框change事件触发两次

说明:在项目中使用了element框架,在el-table中嵌套了el-checkbox,代码和渲染效果如下,当点击复选框时要做一些事情。
问题:当点击复选框时,事件函数chooseChange会偶尔触发两次,并且获取到的checked是相反的。这是为什么呢?如何解决?

<el-table :data="tableData">
    <el-table-column label="操作" width="100px">
        <template slot-scope="{ row }">
            <el-checkbox v-model="row.checked" @change="chooseChange"></el-checkbox>
        </template>
     </el-table-column>
</el-table>
               

image.png

阅读 5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题