let isOverflow = this.$refs.isOverflow;
for (let i in isOverflow) {
let cWidth = isOverflow[i].clientWidth;
let sWidth = isOverflow[i].scrollWidth;
if (sWidth > cWidth) { //超过
this.$set(this.isEllipsis, i, true);
} else {
this.$set(this.isEllipsis, i, false);
}
}
vue 判断元素内容是否超过宽度
猜你喜欢
转载自blog.csdn.net/qq_34607371/article/details/102500420
今日推荐
周排行