a-table 設定

凯宾斯基發表於2024-06-20
 <a-table
      :columns="columns"
      :data-source="data"
      :scroll="{ x: 0, y: 300 }"  控制列表預設最大和最小高度
      :showHeader="false"    是否展示表頭
      :pagination="false"
      :loading="iterations_loading"
    >
      <span slot="name" slot-scope="record"> {{ record }} </span>

      <span slot="check" slot-scope="record">
        <a-checkbox checked="record"
          ><span v-if="false">{{ record }}</span></a-checkbox
        >
      </span>
    </a-table>
    
              
              
   data() {
    return {
      columns: [
        {
          title: "測試人員",
          dataIndex: "name",
          key: "name",
          scopedSlots: { customRender: "name" },
        },
        {
          title: "週報資料確認",
          dataIndex: "check",
          key: "check",
          scopedSlots: { customRender: "check" },
        },
      ],
      data: [
        { name: "zhangsan", check: "true" },
        { name: "zhangsan", check: "true" },
        { name: "zhangsan", check: "true" },
        { name: "zhangsan", check: "true" },
        { name: "zhangsan", check: "true" },
        { name: "zhangsan", check: "true" },
      ],
      iterations_loading: false,
    };
  },
              
              
              
              

相關文章