当前位置: 代码迷 >> 综合 >> vue 判断元素内容是否超过宽度
  详细解决方案

vue 判断元素内容是否超过宽度

热度:65   发布时间:2023-10-10 19:52:42.0
                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);}}

 

  相关解决方案