vue3判断文本是否溢出
2024年1月25日小于 1 分钟约 84 字
function testOverfolw() {
let cHeight = window.document.getElementById("rightContent").clientHeight;
let sHeight = window.document.getElementById("rightContent").scrollHeight;
if (sHeight < cHeight) {
console.log("lx3 已经溢出显示省略号 test",test);
} else {
console.log("lx3 没有溢出 test", test.value);
}
}通过ref获取数据
