<ul>
      <h3 class="tit">资产信息</h3>
      <li>
        <span class="key">品牌</span>
        <span class="val">{{equipData.eq_std}}</span>
      </li>
      <li>
        <span class="key">产地</span>
        <span class="val">{{equipData.origin}}</span>
      </li>
      <li>
        <span class="key">生产厂家</span>
        <span class="val">{{equipData.mfr}}</span>
      </li>
      <li>
        <span class="key">移交类型</span>
        <span class="val">{{is_transfer}}</span>
      </li>
      <li>
        <span class="key">制造日期</span>
        <span class="val">{{equipData.date_manufactured}}</span>
      </li>
      <li>
        <span class="key">采购日期</span>
        <span class="val">{{equipData.date_purchased}}</span>
      </li>
      <li>
        <span class="key">安装日期</span>
        <span class="val">{{equipData.date_installed}}</span>
      </li>
      <li>
        <span class="key">验收日期</span>
        <span class="val">{{equipData.date_accept}}</span>
      </li>
      <li>
        <span class="key">启用日期</span>
        <span class="val">{{equipData.date_in_service}}</span>
      </li>
      <li>
        <span class="key">接管日期</span>
        <span class="val">{{equipData.date_takeover}}</span>
      </li>
      <li>
        <span class="key">进场日期</span>
        <span class="val">{{equipData.date_entrance}}</span>
      </li>
      <li>
        <span class="key">下次整机年检日期</span>
        <span class="val">{{equipData.date_next_yearly}}</span>
      </li>
      <li>
        <span class="key">最近一次故障处理日期</span>
        <span class="val">{{equipData.date_lately_fault}}</span>
      </li>
    </ul>
    <div class="dialog" v-if="dialog" :style="{top:oHight}">
     {{con}}
    </div>

按下span class=val标签时,显示悬浮框,内容是span的innerText,松开手,悬浮框消失

 var oVal = document.getElementsByClassName('val');
oVal[i].addEventListener("touchstart",  (e)=>{//e就是事件
                if(e.target.offsetWidth==oWidth){
                  th.con = e.target.innerText;
                  th.dialog = true;
                }
              })
              oVal[i].addEventListener("touchend",  (e)=>{
                  th.dialog = false
              })
            }

还有移动事件,touchmove


本文转载:CSDN博客