首页 > 用es6写vue单文件应用,写分页组件时候遇到的问题vue-resource请求没反应

用es6写vue单文件应用,写分页组件时候遇到的问题vue-resource请求没反应

ready () {
    this.$http.get('../blog/index.json').then(function (response) {
      // 确定页面数量
      let len = Math.ceil(response.data.length / this.eachPageNum)
      for (var i = 1; i <= len; i++) {
        this.pagenumdata.push({text: 'Page+i', 'value': i})
      }
      // 获取的数据response.data
      this.listdata = response.data
      this.setView(this.listdata)
    })
}

我用引用vue.js和vue-resource.js的方式写了一个分页组件,调试没有问题,现在想改成vue单文件的形式不知道哪里出错咯,有没有人给我vue-resource模块化引用的例子。


用 window.alert


换成网络地址就可以了

【热门文章】
【热门文章】