computed: {
    rowSelection() {
      const _this = this
      const { selectedRowKeys } = this
      return {
        selectedRowKeys,
        onChange: (selectedRowKeys) => {
          this.selectedRowKeys = selectedRowKeys
        },
        getCheckboxProps: (record) => ({
         props: {
             // 全部默认禁止选中
             // disabled: true,
             // 某几项默认禁止选中(R: 当state等于1时)
             disabled: record.state === 1,
       // 某几项默认选中(R: 当state等于1时)
       // defaultChecked: record.state == 1,
     },
    }),
   }
  },
},
 <a-table
  ref="table"
  size="middle"
  bordered
  rowKey="id"
 :columns="columns"
 :dataSource="dataSource"
:pagination="ipagination" :rowSelection="rowSelection" :loading="tableLoading" class="j-table-force-nowrap" > <!-- 操作 --> <template slot="action" slot-scope="text, record"> <router-link :to="{name: 'bulkDelivery', params: {id: record.id}}">发货</router-link> </template>
</a-table>

查看效果:

antDesignOfVue 符合条件的表格复选框禁止选中

 

 全选也不会被选中

antDesignOfVue 符合条件的表格复选框禁止选中

 

 完美~~

相关文章:

  • 2022-12-23
  • 2021-08-17
  • 2021-12-24
  • 2022-01-21
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-02-23
  • 2021-10-04
  • 2021-05-19
相关资源
相似解决方案