zoukankan      html  css  js  c++  java
  • antDesignOfVue 符合条件的表格复选框禁止选中

    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>

    查看效果:

     全选也不会被选中

     完美~~

  • 相关阅读:
    js将时间戳转化为时间,(不省略0)
    SpringMVC路径传参
    贪心算法及实例
    剪绳子(贪心算法)
    c语言输入一行未知个数数字存入数组
    Netlink机制详解
    new和malloc的区别
    堆 和 栈的 区别
    strlen与sizeof区别(转载)
    任务
  • 原文地址:https://www.cnblogs.com/xiaomengzhu/p/13615477.html
Copyright © 2011-2022 走看看