vue 圖片加載時的問題


從后台請求數據

請求的數據攜帶有一段html,里面還有圖片,也需要另外加載。

問題是圖片加載一半會很慢,頁面加載完成會要等一會,使用了better-scroll

activated () {
      let id = this.$route.params ? this.$route.params.id : null
      if (id) {
        axios.get('/product/detail.do?productId=' + id).then((res) => {
          this.data = res.data.data
          console.log(this.data)
          this.data.subImages = this.data.subImages.split(',')
          this.swiper.slideTo(0, 0, false)
          this.$nextTick(() => {
            if (!this.scroll) {
              this.scroll = new BScroll(this.$refs.list, {
                click: true
              })
            } else {
              this.scroll.refresh()
            }
          })
        })
      }
    }

圖片未全部加載完成的時候 不能滾動頁面

未能解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM