你直接去改他的底层代码就可以了 找到他项目示例代码里面的components/zb-table/zb-table.vue文件 第320行
加入一个slot插槽
<template v-else-if="ite.type==='slot'">
<slot :name="ite.name"></slot>
</template>
然后在column里面加上
{
name: 'key',
label: '测试',
type: 'slot',
},
在组件里面 这样写 template #key 然后里面的内容就是自定义的了
<zb-table ref="zbTable" @sort-change="sortChange" :pullUpLoading="pullUpLoading" :isShowLoadMore="true"
:highlight="true" :show-header="true" :columns="column" :fit="false" :permissionBtn="permissionBtn"
row-key="id" @rowClick="rowClick" @toggleRowSelection="toggleRowSelection"
@toggleAllSelection="toggleAllSelection" :border="true" @custom="custom" @edit="buttonEdit"
@dele="dele" :data="data">
<template #key>
<div style="color: red;">
<image src="../../static/logo.png" style="width:20rpx; height: 20rpx" mode=""></image>
1111
</div>
</template>
</zb-table>
2 个回复
1***@qq.com
你直接去改他的底层代码就可以了 找到他项目示例代码里面的components/zb-table/zb-table.vue文件 第320行
加入一个slot插槽
然后在column里面加上
在组件里面 这样写 template #key 然后里面的内容就是自定义的了
昭昭L - 开心就好
uni-switch组件