fix: 未设置 width 的 column 自动分配宽度

This commit is contained in:
就眠儀式 2022-04-19 01:04:39 +08:00
parent 8a94ba4511
commit 223c6ab0c6
2 changed files with 7 additions and 2 deletions

View File

@ -270,7 +270,11 @@ onMounted(() => {
<template v-for="column in columns" :key="column">
<th
class="layui-table-cell"
:style="{ width: column.width, textAlign: column.align }"
:style="{
width: column.width,
textAlign: column.align,
flex: column.width ? 'none' : 'auto',
}"
v-if="tableColumnKeys.includes(column.key)"
>
<span>
@ -335,6 +339,7 @@ onMounted(() => {
:style="{
width: column.width,
textAlign: column.align,
flex: column.width ? 'none' : 'auto',
}"
>
<slot :name="column.customSlot" :data="data"></slot>
@ -352,6 +357,7 @@ onMounted(() => {
:style="{
width: column.width,
textAlign: column.align,
flex: column.width ? 'none' : 'auto',
}"
>
<span> {{ value }} </span>

View File

@ -270,7 +270,6 @@ export default {
}
,{
title:"操作",
width: "180px",
customSlot:"operator",
key:"operator"
}