Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Lucky高
vue-vben-admin
提交
a23020b7
V
vue-vben-admin
项目概览
Lucky高
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a23020b7
编写于
3月 11, 2022
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): 修复antd报错,将column.slots修改为v-slot:headerCell
上级
af6ab989
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
11643 addition
and
13 deletion
+11643
-13
src/components/Table/src/BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-1
src/components/Table/src/hooks/useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+2
-2
src/views/demo/table/CustomerCell.vue
src/views/demo/table/CustomerCell.vue
+6
-6
src/views/demo/table/ExpandTable.vue
src/views/demo/table/ExpandTable.vue
+1
-1
src/views/demo/table/FixedColumn.vue
src/views/demo/table/FixedColumn.vue
+1
-1
src/views/demo/table/tableData.tsx
src/views/demo/table/tableData.tsx
+2
-2
yarn.lock
yarn.lock
+11630
-0
未找到文件。
src/components/Table/src/BasicTable.vue
浏览文件 @
a23020b7
...
...
@@ -26,7 +26,7 @@
<slot
:name=
"item"
v-bind=
"data ||
{}">
</slot>
</
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"
/>
</
template
>
</Table>
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
a23020b7
...
...
@@ -152,10 +152,10 @@ export function useColumns(
return
hasPermission
(
column
.
auth
)
&&
isIfShow
(
column
);
})
.
map
((
column
)
=>
{
const
{
slots
,
dataIndex
,
customRender
,
format
,
edit
,
editRow
,
flag
}
=
column
;
const
{
slots
,
customRender
,
format
,
edit
,
editRow
,
flag
}
=
column
;
if
(
!
slots
||
!
slots
?.
title
)
{
column
.
slots
=
{
title
:
`header-
${
dataIndex
}
`
,
...(
slots
||
{})
};
//
column.slots = { title: `header-${dataIndex}`, ...(slots || {}) };
column
.
customTitle
=
column
.
title
;
Reflect
.
deleteProperty
(
column
,
'
title
'
);
}
...
...
src/views/demo/table/CustomerCell.vue
浏览文件 @
a23020b7
...
...
@@ -32,13 +32,13 @@
{
title
:
'
ID
'
,
dataIndex
:
'
id
'
,
slots
:
{
customRender
:
'
id
'
},
//
slots: { customRender: 'id' },
},
{
title
:
'
头像
'
,
dataIndex
:
'
avatar
'
,
width
:
100
,
slots
:
{
customRender
:
'
avatar
'
},
//
slots: { customRender: 'avatar' },
},
{
title
:
'
分类
'
,
...
...
@@ -46,7 +46,7 @@
width
:
80
,
align
:
'
center
'
,
defaultHidden
:
true
,
slots
:
{
customRender
:
'
category
'
},
//
slots: { customRender: 'category' },
},
{
title
:
'
姓名
'
,
...
...
@@ -58,13 +58,13 @@
dataIndex
:
'
imgArr
'
,
helpMessage
:
[
'
这是简单模式的图片列表
'
,
'
只会显示一张在表格中
'
,
'
但点击可预览多张图片
'
],
width
:
140
,
slots
:
{
customRender
:
'
img
'
},
//
slots: { customRender: 'img' },
},
{
title
:
'
照片列表2
'
,
dataIndex
:
'
imgs
'
,
width
:
160
,
slots
:
{
customRender
:
'
imgs
'
},
//
slots: { customRender: 'imgs' },
},
{
title
:
'
地址
'
,
...
...
@@ -73,7 +73,7 @@
{
title
:
'
编号
'
,
dataIndex
:
'
no
'
,
slots
:
{
customRender
:
'
no
'
},
//
slots: { customRender: 'no' },
},
{
title
:
'
开始时间
'
,
...
...
src/views/demo/table/ExpandTable.vue
浏览文件 @
a23020b7
...
...
@@ -53,7 +53,7 @@
actionColumn
:
{
width
:
160
,
title
:
'
Action
'
,
slots
:
{
customRender
:
'
action
'
},
//
slots: { customRender: 'action' },
},
});
function
handleDelete
(
record
:
Recordable
)
{
...
...
src/views/demo/table/FixedColumn.vue
浏览文件 @
a23020b7
...
...
@@ -74,7 +74,7 @@
width
:
160
,
title
:
'
Action
'
,
dataIndex
:
'
action
'
,
slots
:
{
customRender
:
'
action
'
},
//
slots: { customRender: 'action' },
},
});
function
handleDelete
(
record
:
Recordable
)
{
...
...
src/views/demo/table/tableData.tsx
浏览文件 @
a23020b7
...
...
@@ -123,13 +123,13 @@ export function getCustomHeaderColumns(): BasicColumn[] {
// title: '姓名',
dataIndex
:
'
name
'
,
width
:
120
,
slots
:
{
title
:
'
customTitle
'
},
//
slots: { title: 'customTitle' },
},
{
// title: '地址',
dataIndex
:
'
address
'
,
width
:
120
,
slots
:
{
title
:
'
customAddress
'
},
//
slots: { title: 'customAddress' },
sorter
:
true
,
},
...
...
yarn.lock
0 → 100644
浏览文件 @
a23020b7
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录