mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-28 00:42:12 +08:00
fix(upload): fix file upload key loss #120
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent, CSSProperties } from 'vue';
|
||||||
import { fileListProps } from './props';
|
import { fileListProps } from './props';
|
||||||
import { isFunction } from '/@/utils/is';
|
import { isFunction } from '/@/utils/is';
|
||||||
import './FileList.less';
|
import './FileList.less';
|
||||||
@@ -16,11 +16,13 @@ export default defineComponent({
|
|||||||
<colgroup>
|
<colgroup>
|
||||||
{columnList.map((item) => {
|
{columnList.map((item) => {
|
||||||
const { width = 0, dataIndex } = item;
|
const { width = 0, dataIndex } = item;
|
||||||
return width ? (
|
|
||||||
<col style={'width:' + width + 'px;min-width:' + width + 'px;'} key={dataIndex} />
|
const style: CSSProperties = {
|
||||||
) : (
|
width: `${width}px`,
|
||||||
<col />
|
minWidth: `${width}px`,
|
||||||
);
|
};
|
||||||
|
|
||||||
|
return <col style={width ? style : {}} key={dataIndex} />;
|
||||||
})}
|
})}
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
@@ -38,22 +40,17 @@ export default defineComponent({
|
|||||||
<tbody>
|
<tbody>
|
||||||
{dataSource.map((record = {}) => {
|
{dataSource.map((record = {}) => {
|
||||||
return (
|
return (
|
||||||
<tr class="file-table-tr">
|
<tr class="file-table-tr" key={record.uuid}>
|
||||||
{columnList.map((item) => {
|
{columnList.map((item) => {
|
||||||
const { dataIndex = '', customRender, align = 'center' } = item;
|
const { dataIndex = '', customRender, align = 'center' } = item;
|
||||||
if (customRender && isFunction(customRender)) {
|
const render = customRender && isFunction(customRender);
|
||||||
return (
|
return (
|
||||||
<td class={['file-table-td', align]} key={dataIndex}>
|
<td class={['file-table-td', align]} key={dataIndex}>
|
||||||
{customRender({ text: record[dataIndex], record })}
|
{render
|
||||||
|
? customRender?.({ text: record[dataIndex], record })
|
||||||
|
: record[dataIndex]}
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<td class={['file-table-td', align]} key={dataIndex}>
|
|
||||||
{record[dataIndex]}
|
|
||||||
</td>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})}
|
})}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user