interview-answe icon indicating copy to clipboard operation
interview-answe copied to clipboard

60.js 如何判断文本内容是否换行了?

Open webVueBlog opened this issue 5 years ago • 2 comments

[js]

webVueBlog avatar Mar 17 '20 03:03 webVueBlog

通过计算内容宽度,算出容器宽度,来比较宽度是否超过容器

计算总宽度和字体宽度,通过字数判断更合适!

webVueBlog avatar Mar 17 '20 03:03 webVueBlog

通过字数要考虑中文还是英文,算总宽度和内容宽度是比较好的办法

cduyzh avatar Jan 05 '21 14:01 cduyzh