Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
a23020b7
提交
a23020b7
authored
3月 11, 2022
作者:
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): 修复antd报错,将column.slots修改为v-slot:headerCell
上级
af6ab989
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-1
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+2
-2
CustomerCell.vue
src/views/demo/table/CustomerCell.vue
+6
-6
ExpandTable.vue
src/views/demo/table/ExpandTable.vue
+1
-1
FixedColumn.vue
src/views/demo/table/FixedColumn.vue
+1
-1
tableData.tsx
src/views/demo/table/tableData.tsx
+2
-2
yarn.lock
yarn.lock
+0
-0
没有找到文件。
src/components/Table/src/BasicTable.vue
浏览文件 @
a23020b7
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<slot
:name=
"item"
v-bind=
"data ||
{}">
</slot>
<slot
:name=
"item"
v-bind=
"data ||
{}">
</slot>
</
template
>
</
template
>
<
template
#
[`
header-
${
column
.
dataIndex
}`]
v-for=
"(column, index) in columns"
:key=
"index"
>
<
template
#
headerCell
v-for=
"(column, index) in columns"
:key=
"index"
>
<HeaderCell
:column=
"column"
/>
<HeaderCell
:column=
"column"
/>
</
template
>
</
template
>
</Table>
</Table>
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
a23020b7
...
@@ -152,10 +152,10 @@ export function useColumns(
...
@@ -152,10 +152,10 @@ export function useColumns(
return
hasPermission
(
column
.
auth
)
&&
isIfShow
(
column
);
return
hasPermission
(
column
.
auth
)
&&
isIfShow
(
column
);
})
})
.
map
((
column
)
=>
{
.
map
((
column
)
=>
{
const
{
slots
,
dataIndex
,
customRender
,
format
,
edit
,
editRow
,
flag
}
=
column
;
const
{
slots
,
customRender
,
format
,
edit
,
editRow
,
flag
}
=
column
;
if
(
!
slots
||
!
slots
?.
title
)
{
if
(
!
slots
||
!
slots
?.
title
)
{
column
.
slots
=
{
title
:
`header-
${
dataIndex
}
`
,
...(
slots
||
{})
};
//
column.slots = { title: `header-${dataIndex}`, ...(slots || {}) };
column
.
customTitle
=
column
.
title
;
column
.
customTitle
=
column
.
title
;
Reflect
.
deleteProperty
(
column
,
'title'
);
Reflect
.
deleteProperty
(
column
,
'title'
);
}
}
...
...
src/views/demo/table/CustomerCell.vue
浏览文件 @
a23020b7
...
@@ -32,13 +32,13 @@
...
@@ -32,13 +32,13 @@
{
{
title
:
'ID'
,
title
:
'ID'
,
dataIndex
:
'id'
,
dataIndex
:
'id'
,
slots
:
{
customRender
:
'id'
},
//
slots: { customRender: 'id' },
},
},
{
{
title
:
'头像'
,
title
:
'头像'
,
dataIndex
:
'avatar'
,
dataIndex
:
'avatar'
,
width
:
100
,
width
:
100
,
slots
:
{
customRender
:
'avatar'
},
//
slots: { customRender: 'avatar' },
},
},
{
{
title
:
'分类'
,
title
:
'分类'
,
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
width
:
80
,
width
:
80
,
align
:
'center'
,
align
:
'center'
,
defaultHidden
:
true
,
defaultHidden
:
true
,
slots
:
{
customRender
:
'category'
},
//
slots: { customRender: 'category' },
},
},
{
{
title
:
'姓名'
,
title
:
'姓名'
,
...
@@ -58,13 +58,13 @@
...
@@ -58,13 +58,13 @@
dataIndex
:
'imgArr'
,
dataIndex
:
'imgArr'
,
helpMessage
:
[
'这是简单模式的图片列表'
,
'只会显示一张在表格中'
,
'但点击可预览多张图片'
],
helpMessage
:
[
'这是简单模式的图片列表'
,
'只会显示一张在表格中'
,
'但点击可预览多张图片'
],
width
:
140
,
width
:
140
,
slots
:
{
customRender
:
'img'
},
//
slots: { customRender: 'img' },
},
},
{
{
title
:
'照片列表2'
,
title
:
'照片列表2'
,
dataIndex
:
'imgs'
,
dataIndex
:
'imgs'
,
width
:
160
,
width
:
160
,
slots
:
{
customRender
:
'imgs'
},
//
slots: { customRender: 'imgs' },
},
},
{
{
title
:
'地址'
,
title
:
'地址'
,
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
{
{
title
:
'编号'
,
title
:
'编号'
,
dataIndex
:
'no'
,
dataIndex
:
'no'
,
slots
:
{
customRender
:
'no'
},
//
slots: { customRender: 'no' },
},
},
{
{
title
:
'开始时间'
,
title
:
'开始时间'
,
...
...
src/views/demo/table/ExpandTable.vue
浏览文件 @
a23020b7
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
actionColumn
:
{
actionColumn
:
{
width
:
160
,
width
:
160
,
title
:
'Action'
,
title
:
'Action'
,
slots
:
{
customRender
:
'action'
},
//
slots: { customRender: 'action' },
},
},
});
});
function
handleDelete
(
record
:
Recordable
)
{
function
handleDelete
(
record
:
Recordable
)
{
...
...
src/views/demo/table/FixedColumn.vue
浏览文件 @
a23020b7
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
width
:
160
,
width
:
160
,
title
:
'Action'
,
title
:
'Action'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
slots
:
{
customRender
:
'action'
},
//
slots: { customRender: 'action' },
},
},
});
});
function
handleDelete
(
record
:
Recordable
)
{
function
handleDelete
(
record
:
Recordable
)
{
...
...
src/views/demo/table/tableData.tsx
浏览文件 @
a23020b7
...
@@ -123,13 +123,13 @@ export function getCustomHeaderColumns(): BasicColumn[] {
...
@@ -123,13 +123,13 @@ export function getCustomHeaderColumns(): BasicColumn[] {
// title: '姓名',
// title: '姓名',
dataIndex
:
'name'
,
dataIndex
:
'name'
,
width
:
120
,
width
:
120
,
slots
:
{
title
:
'customTitle'
},
//
slots: { title: 'customTitle' },
},
},
{
{
// title: '地址',
// title: '地址',
dataIndex
:
'address'
,
dataIndex
:
'address'
,
width
:
120
,
width
:
120
,
slots
:
{
title
:
'customAddress'
},
//
slots: { title: 'customAddress' },
sorter
:
true
,
sorter
:
true
,
},
},
...
...
yarn.lock
0 → 100644
浏览文件 @
a23020b7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论