Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0e4de1b3
authored
Apr 14, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
other:去除注释
1 parent
1066997a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/filters/index.js
src/filters/index.js
View file @
0e4de1b
...
...
@@ -57,7 +57,7 @@ export const handlerFn = (str, originLen, line = 1) => {
* @returns {string} 截取后的字符串
*/
export
function
getStrByWith
(
desc
,
width
,
fontsize
)
{
console
.
log
(
'desc: '
,
desc
);
//
console.log('desc: ', desc);
var
span
=
document
.
createElement
(
'span'
)
span
.
id
=
'cut'
span
.
style
.
visibility
=
'hidden'
...
...
@@ -70,7 +70,7 @@ export function getStrByWith(desc, width, fontsize) {
// desc是目标字符串,
temp
+=
desc
[
j
]
span
.
innerText
=
temp
console
.
log
(
'span.offsetWidth'
,
span
.
offsetWidth
,
width
)
//
console.log('span.offsetWidth', span.offsetWidth, width)
if
(
span
.
offsetWidth
>
width
)
{
boo
=
true
break
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment