Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
tianzhuanghu
ant-design-pro-vue
Commits
686a2b72
Commit
686a2b72
authored
Jan 02, 2019
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ellipsis full length out '...'
parent
be1fafab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
Ellipsis.vue
src/components/Ellipsis/Ellipsis.vue
+14
-14
router.config.js
src/config/router.config.js
+0
-0
No files found.
src/components/Ellipsis/Ellipsis.vue
View file @
686a2b72
<
script
>
<
script
>
import
Tooltip
from
'ant-design-vue/es/tooltip'
import
Tooltip
from
'ant-design-vue/es/tooltip'
import
{
cutStrByFullLength
,
getStrFullLength
}
from
'@/components/_util/StringUtil'
import
{
cutStrByFullLength
,
getStrFullLength
}
from
'@/components/_util/StringUtil'
/*
/*
const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined;
const TooltipOverlayStyle = {
const TooltipOverlayStyle = {
overflowWrap: 'break-word',
overflowWrap: 'break-word',
wordWrap: 'break-word',
wordWrap: 'break-word',
};
};
*/
*/
export
default
{
export
default
{
name
:
'Ellipsis'
,
name
:
'Ellipsis'
,
...
@@ -37,16 +37,16 @@
...
@@ -37,16 +37,16 @@
}
}
},
},
methods
:
{
methods
:
{
getStrDom
(
str
)
{
getStrDom
(
str
,
fullLength
)
{
return
(
return
(
<
span
>
{
cutStrByFullLength
(
str
,
this
.
length
)
+
'...'
}
<
/span
>
<
span
>
{
cutStrByFullLength
(
str
,
this
.
length
)
+
(
fullLength
>
this
.
length
?
'...'
:
''
)
}
<
/span
>
)
)
},
},
getTooltip
(
fullStr
)
{
getTooltip
(
fullStr
,
fullLength
)
{
return
(
return
(
<
Tooltip
>
<
Tooltip
>
<
template
slot
=
"title"
>
{
fullStr
}
<
/template
>
<
template
slot
=
"title"
>
{
fullStr
}
<
/template
>
{
this
.
getStrDom
(
fullStr
)
}
{
this
.
getStrDom
(
fullStr
,
fullLength
)
}
<
/Tooltip
>
<
/Tooltip
>
)
)
}
}
...
@@ -54,10 +54,11 @@
...
@@ -54,10 +54,11 @@
render
()
{
render
()
{
const
{
tooltip
,
length
}
=
this
.
$props
const
{
tooltip
,
length
}
=
this
.
$props
const
str
=
this
.
$slots
.
default
.
map
(
vNode
=>
vNode
.
text
).
join
(
''
)
const
str
=
this
.
$slots
.
default
.
map
(
vNode
=>
vNode
.
text
).
join
(
''
)
const
strDom
=
tooltip
&&
getStrFullLength
(
str
)
>
length
?
this
.
getTooltip
(
str
)
:
this
.
getStrDom
(
str
)
const
fullLength
=
getStrFullLength
(
str
)
const
strDom
=
tooltip
&&
fullLength
>
length
?
this
.
getTooltip
(
str
,
fullLength
)
:
this
.
getStrDom
(
str
,
fullLength
)
return
(
return
(
strDom
strDom
)
)
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/config/router.config.js
View file @
686a2b72
This diff is collapsed.
Click to expand it.
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