根据不同值需求,设置按钮的disabled禁用可用
可直接在按钮上设置disabled属性的三目运算控制true还是false。
如: :disabled="scope.row.cpzt==1?false:true"
即cpzt属性值为1的该按钮就禁用,其余值得可用
<el-button icon="el-icon-sell" size="small" type="text" @click.stop="handleCell(scope.row,scope.index)">上架</el-button>
<el-button icon="el-icon-tickets" size="small" type="text" @click.stop="handleTickets(scope.row,scope.index)" :disabled="scope.row.cpzt==1||scope.row.cpzt==3?false:true">复核</el-button>
<el-button icon="el-icon-sold-out" size="small" type="text" @click.stop="handleSoldout(scope.row,scope.index)" :disabled="scope.row.cpzt==2?false:true">下架</el-button>
效果如下: