最近做项目遇到el-checkbox选中只能为true和false,而后端需要传1和0,返回时也是一样
<el-table-column label="是否答案" width="120" align="center">
<template slot-scope="scope">
<!-- <el-checkbox v-model="scope.row.isRight" >答案</el-checkbox> -->
<el-checkbox v-model="scope.row.isRight" :checked="scope.row.isRight===1? true:false" :true-label="1"
:false-label="0">
答案
</el-checkbox>
</template>
</el-table-column>


网友评论