在vue-router文檔數(shù)據(jù)獲取一章的時候,有一段代碼展示了再導(dǎo)航完成之后獲取數(shù)據(jù),其中使用了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:數(shù)據(jù)獲取
請問getPost()是什么方法,有出處嗎?
鴻蒙傳說
2018-10-26 16:09:56