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

图片未全部加载完成的时候 不能滚动页面

未能解决

posted @ 2017-11-24 11:03  静静的fire  阅读(3466)  评论(1编辑  收藏  举报