vue 圖片加載時的問題

從後臺請求數據html

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

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

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()
            }
          })
        })
      }
    }

圖片未所有加載完成的時候 不能滾動頁面ide

未能解決this

相關文章
相關標籤/搜索