Post

antd table 自定义表头

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<template slot="run">
<span>船名船号</span>
<a-dropdown :trigger="['click']">
    <a-icon
    style="color: #bfbfbf; margin-left: 8px"
    type="interaction"
    @click.stop
    />
    <a-menu slot="overlay">
    <a-menu-item key="0">
        <a-radio>按中文排序</a-radio>
    </a-menu-item>
    <a-menu-item key="1">
        <a-radio>按数字排序</a-radio>
    </a-menu-item>
    </a-menu>
</a-dropdown>
</template>


{
    // title: "船名船号", -------->必须注释
    dataIndex: "name",
    key: "name",
    width: "20%",
    slots: { title: "run" },
    sorter: (a, b) => a.name.localeCompare(b.name, "zh-CN"),
},
This post is licensed under CC BY 4.0 by the author.