zoukankan      html  css  js  c++  java
  • 文字超出 省略号显示 并显示提示框!

    //目的: 该方法调用会将新闻数组的每一项中添加“isOverflow”字段 (true为内容过长)  每次取请求数据改变都要调用该方法
    
    //参数:news  是你需要检测的元素 (也就是上图的acceptValueList)
    
    isShowTextContent(news){
    
      this.$nextTick(function(){
    
        this.$refs[news].forEach((item,index)=>{
    
          let cWidth = this.$refs[news][index].clientWidth
    
          let sWidth = this.$refs[news][index].scrollWidth
    
          if(sWidth>cWidth){
    
            this.$set(this.[news][index],"isOverflow",true)
          }else{
    
            this.$set(this.[news][index],"isOverflow",false)
          }
        })
    
      })
    
    }

  • 相关阅读:
    POJ2524+并查集
    POJ3697+BFS+hash存边
    POJ1151+线段树+扫描线
    POJ2528+线段树
    ubuntu 和 win7 远程登陆 + vnc登陆
    POJ3690+位运算
    POJ3283+字典树
    POJ3282+模拟
    POJ2349+prim
    2016.6.13
  • 原文地址:https://www.cnblogs.com/wxqworld/p/12100661.html
Copyright © 2011-2022 走看看