Skip to content

table template 模式二次封装 动态tempalte slot 不渲染 #1728

@callmesoul

Description

@callmesoul
// v-table
<div class="v-table">
<a-table
          @change="handleTableChange"
          :columns="columns"
          :scopedSlots="$scopedSlots"
          :scroll="{ y: true }"
          :dataSource="datas"
          :loading="loading"
          :pagination="{ total: pagination.totalPages * pagination.offSize, defaultPageSize: pagination.offSize, current: pagination.offSet, pageSize: pagination.offSize, showSizeChanger: true, showQuickJumper: true, pageSizeOptions: $store.state.app.pageSizeOptions }">
</a-table>
</div>

use:

<v-table :columns="columns" :datas="datas" :loading="loading">
      <div slot="state" slot-scope="item"><a-switch checkedChildren="启用" unCheckedChildren="禁用" :loading="item.loading" :checked="item.state" @click="changeState(item)" /></div> //不渲染
  </v-table>

怎样才可以动态传过去又可以渲染自定义column呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions