antdv坑 - table组件 slot无效
文章目录
仿照官方文档第一个例子写了一下,发现没有生效,排查了半天,发现是:
column各属性如果同时定义了属性本身和其对应的slot属性的话,则优先生效属性本身,因此slot属性无效
<a-table :columns="columns">
<template slot="titleFill"> - a名称 - </template>
</a-table>
const columns = [{
title: '名称',
key: 'name',
dataIndex: 'name',
slots: { title: 'titleFill' }, // 此时titleFill不生效,表头还是会展示“名称”,而不是"- a名称 -"
scopedSlots: { customRender: 'nameFill' }
}]
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论