为了账号安全,请及时绑定邮箱和手机立即绑定

请问getPost()是什么方法,有出处吗?

请问getPost()是什么方法,有出处吗?

鸿蒙传说 2018-10-26 16:09:56
在vue-router文档数据获取一章的时候,有一段代码展示了再导航完成之后获取数据,其中使用了getPost()方法,查了一下没找到这个方法,有人知道吗?methods: {    fetchData () {      this.error = this.post = null      this.loading = true      // replace getPost with your data fetching util / API wrapper      getPost(this.$route.params.id, (err, post) => {        this.loading = false        if (err) {          this.error = err.toString()        } else {          this.post = post        }      })    }  }原文并不长,只有三段话,可以看看原文vue-router:数据获取
查看完整描述

1 回答

?
慕标琳琳

TA贡献1830条经验 获得超9个赞

看上边那句注释:

// replace getPost with your data fetching util / API wrapper

(用的时候)替换getPost为你自己的数据fetching工具或者API


查看完整回答
反对 回复 2018-11-17
  • 1 回答
  • 0 关注
  • 895 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号