feat: table 支持标题自定义

This commit is contained in:
就眠儀式
2022-03-28 01:53:53 +08:00
parent 529d21c593
commit 7d39b0e267
4 changed files with 16 additions and 6 deletions

View File

@@ -246,12 +246,19 @@ onMounted(() => {
</th>
<template v-for="column in columns" :key="column">
<th v-if="tableColumnKeys.includes(column.key)">
<!-- TODO Table header slot -->
<div
class="layui-table-cell"
:style="{ width: column.width }"
>
<span>{{ column.title }}</span>
<span v-if="column.titleSlot">
<template v-if="column.titleSlot">
<slot :name="column.titleSlot"></slot>
</template>
<template>
{{column.title}}
</template>
</span>
<span v-else>{{ column.title }}</span>
<span
v-if="column.sort"
class="layui-table-sort layui-inline"