部分瀏覽器實現Vue分頁,需要修改css屬性pointer-events,解決首頁、尾頁翻頁問題

  在Vue框架中,實現分頁操作,數據正常顯示,當前頁爲第一頁,卻還可以點擊上一頁,當前頁爲第最後一頁,卻還可以點擊下一頁。這跟瀏覽器的版本有關係,需要修改css樣式。

頁面片段:
    <a
      :class="{undisable: !data.hasPrevious}"
      href="#"
      title="首頁"
      @click.prevent="gotoPage(1)">首頁</a>

解決方案:

  找到該頁面的css樣式,Ctrl+f進行搜索“undisable”,本頁面有兩處,加入pointer-events:none;屬性即可。

pointer-events:設置或檢索在何時成爲屬性事件的target

.c-infor-title{height:18px;overflow:hidden}
.c-infor-title span{border-left:5px solid #333;color:#333;font-size:16px;display:inline-block;line-height:18px;padding-left:10px}
.paging{padding:50px 0 20px;text-align:center}
.paging a{border:1px solid #ccc;border-radius:40%;color:#666;display:inline-block;margin:0 5px;height:30px;width:30px;text-align:center;line-height:30px;transition:.3s;-webkit-transition:.3s}
.paging a.current,.paging a.undisable{pointer-events:none;cursor:text}
.paging a.undisable:hover{pointer-events:none;border:1px solid #ccc;border-radius:40%;color:#666}
.paging a.current,.paging a:hover{border-radius:50%;text-decoration:none}
.bMask{background:#000;opacity:.3;filter:alpha(opacity=30);position:fixed;height:100%;width:100%;top:0;right:0;bottom: 0;left:0;z-index:99999}
.dialogWrap{background:#fff;position:absolute;left:50%;transition:all .3s ease 0s;z-index:9999999}
.d-s-head,.d-s-head-infor{border-bottom:1px solid #e2e2e2;height:40px;line-height:40px;padding:0 15px;width:100%}
.d-s-head-txt,.d-s-head-txt-infor{color:#333;font-size:16px}
.dClose{right:10px;top:15px}

♚學習、實戰、總結、分享,讓生活變得更美好!
☞林大俠博客:https://coding0110lin.blog.csdn.net/  歡迎轉載,一起技術交流探討!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章