Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
e09e0a12
Commit
e09e0a12
authored
Dec 31, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(table): wrong tag label style #134
parent
d9b58e46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+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
No files found.
src/components/Table/src/hooks/useColumns.ts
View file @
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
View file @
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
View file @
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment