Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Lucky高
vue-vben-admin
提交
e09e0a12
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,体验更适合开发者的 AI 搜索 >>
提交
e09e0a12
编写于
12月 31, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): wrong tag label style #134
上级
d9b58e46
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
10 deletion
+30
-10
src/components/Table/src/hooks/useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+12
-2
src/components/Table/src/style/index.less
src/components/Table/src/style/index.less
+4
-8
src/views/demo/table/CustomerCell.vue
src/views/demo/table/CustomerCell.vue
+14
-0
未找到文件。
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
e09e0a12
...
...
@@ -40,12 +40,12 @@ function handleIndexColumn(
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
,
columns
:
BasicColumn
[]
)
{
const
{
showIndexColumn
,
indexColumnProps
,
ellipsis
}
=
unref
(
propsRef
);
const
{
showIndexColumn
,
indexColumnProps
}
=
unref
(
propsRef
);
let
pushIndexColumns
=
false
;
columns
.
forEach
((
item
)
=>
{
const
{
children
}
=
item
;
handleItem
(
item
,
!!
ellipsis
);
const
isTreeTable
=
children
&&
children
.
length
;
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
INDEX_COLUMN_FLAG
);
...
...
@@ -114,6 +114,16 @@ export function useColumns(
if
(
!
columns
)
{
return
[];
}
const
{
ellipsis
}
=
unref
(
propsRef
);
columns
.
forEach
((
item
)
=>
{
const
{
customRender
,
slots
}
=
item
;
handleItem
(
item
,
Reflect
.
has
(
item
,
'
ellipsis
'
)
?
!!
item
.
ellipsis
:
!!
ellipsis
&&
!
customRender
&&
!
slots
);
});
return
columns
;
});
...
...
src/components/Table/src/style/index.less
浏览文件 @
e09e0a12
...
...
@@ -24,20 +24,16 @@
}
}
&-img__preview {
display: flex;
img {
margin-right: 4px;
}
}
&--inset {
.ant-table-wrapper {
padding: 0;
}
}
.ant-tag {
margin-right: 0;
}
.ant-table-wrapper {
padding: 8px;
background: #fff;
...
...
src/views/demo/table/CustomerCell.vue
浏览文件 @
e09e0a12
...
...
@@ -10,6 +10,12 @@
:imgList=
"['https://picsum.photos/id/66/346/216', 'https://picsum.photos/id/67/346/216']"
/>
</
template
>
<
template
#category=
"{ record }"
>
<Tag
color=
"green"
>
{{
record
.
no
}}
</Tag>
</
template
>
</BasicTable>
</div>
</template>
...
...
@@ -24,6 +30,13 @@
dataIndex
:
'
id
'
,
slots
:
{
customRender
:
'
id
'
},
},
{
title
:
'
分类
'
,
dataIndex
:
'
category
'
,
width
:
80
,
align
:
'
center
'
,
slots
:
{
customRender
:
'
category
'
},
},
{
title
:
'
姓名
'
,
dataIndex
:
'
name
'
,
...
...
@@ -60,6 +73,7 @@
title
:
'
自定义列内容
'
,
api
:
demoListApi
,
columns
:
columns
,
bordered
:
true
,
});
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录