Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
e09e0a12
提交
e09e0a12
authored
12月 31, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): wrong tag label style #134
上级
d9b58e46
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
10 行删除
+30
-10
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+12
-2
index.less
src/components/Table/src/style/index.less
+4
-8
CustomerCell.vue
src/views/demo/table/CustomerCell.vue
+14
-0
没有找到文件。
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
e09e0a12
...
@@ -40,12 +40,12 @@ function handleIndexColumn(
...
@@ -40,12 +40,12 @@ function handleIndexColumn(
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
,
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
,
columns
:
BasicColumn
[]
columns
:
BasicColumn
[]
)
{
)
{
const
{
showIndexColumn
,
indexColumnProps
,
ellipsis
}
=
unref
(
propsRef
);
const
{
showIndexColumn
,
indexColumnProps
}
=
unref
(
propsRef
);
let
pushIndexColumns
=
false
;
let
pushIndexColumns
=
false
;
columns
.
forEach
((
item
)
=>
{
columns
.
forEach
((
item
)
=>
{
const
{
children
}
=
item
;
const
{
children
}
=
item
;
handleItem
(
item
,
!!
ellipsis
);
const
isTreeTable
=
children
&&
children
.
length
;
const
isTreeTable
=
children
&&
children
.
length
;
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
INDEX_COLUMN_FLAG
);
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
INDEX_COLUMN_FLAG
);
...
@@ -114,6 +114,16 @@ export function useColumns(
...
@@ -114,6 +114,16 @@ export function useColumns(
if
(
!
columns
)
{
if
(
!
columns
)
{
return
[];
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
;
return
columns
;
});
});
...
...
src/components/Table/src/style/index.less
浏览文件 @
e09e0a12
...
@@ -24,20 +24,16 @@
...
@@ -24,20 +24,16 @@
}
}
}
}
&-img__preview
{
display:
flex
;
img
{
margin-right:
4
px
;
}
}
&--inset
{
&--inset
{
.
ant-table-wrapper
{
.
ant-table-wrapper
{
padding:
0
;
padding:
0
;
}
}
}
}
.
ant-tag
{
margin-right:
0
;
}
.
ant-table-wrapper
{
.
ant-table-wrapper
{
padding:
8
px
;
padding:
8
px
;
background:
#fff;
background:
#fff;
...
...
src/views/demo/table/CustomerCell.vue
浏览文件 @
e09e0a12
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
:imgList=
"['https://picsum.photos/id/66/346/216', 'https://picsum.photos/id/67/346/216']"
:imgList=
"['https://picsum.photos/id/66/346/216', 'https://picsum.photos/id/67/346/216']"
/>
/>
</
template
>
</
template
>
<
template
#
category=
"{ record }"
>
<Tag
color=
"green"
>
{{
record
.
no
}}
</Tag>
</
template
>
</BasicTable>
</BasicTable>
</div>
</div>
</template>
</template>
...
@@ -25,6 +31,13 @@
...
@@ -25,6 +31,13 @@
slots
:
{
customRender
:
'id'
},
slots
:
{
customRender
:
'id'
},
},
},
{
{
title
:
'分类'
,
dataIndex
:
'category'
,
width
:
80
,
align
:
'center'
,
slots
:
{
customRender
:
'category'
},
},
{
title
:
'姓名'
,
title
:
'姓名'
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
width
:
120
,
width
:
120
,
...
@@ -60,6 +73,7 @@
...
@@ -60,6 +73,7 @@
title
:
'自定义列内容'
,
title
:
'自定义列内容'
,
api
:
demoListApi
,
api
:
demoListApi
,
columns
:
columns
,
columns
:
columns
,
bordered
:
true
,
});
});
return
{
return
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论