封装的组件custom-table.vue

<Table :loading="loading" :columns="columns" :data="data">
<template v-for="column in columns" :slot="column.slot?column.slot:''" slot-scope="params" >
<slot :name="column.slot?column.slot:''" v-bind="params" ></slot>
</template>
</Table>


调用:
<custom-table :columns="columns" :daya="tableData">
<template slot-scope="params" slot="operater">{{params.row.id}}</template> // 跟iview 官网table slot 一样的
</custom-table>

转自:https://www.cnblogs.com/XHappyness/p/13158737.html
posted on 2022-03-10 11:10  仔仔爱学习  阅读(286)  评论(0)    收藏  举报