We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51d40a5 commit 0b073d4Copy full SHA for 0b073d4
docs/guide/advanced/data-fetching.md
@@ -55,8 +55,11 @@ export default {
55
fetchData () {
56
this.error = this.post = null
57
this.loading = true
58
+ const fetchedId = this.$route.params.id
59
// replace `getPost` with your data fetching util / API wrapper
- getPost(this.$route.params.id, (err, post) => {
60
+ getPost(fetchedId, (err, post) => {
61
+ // make sure this request is the last one we did, discard otherwise
62
+ if (this.$route.params.id !== fetchedId) return
63
this.loading = false
64
if (err) {
65
this.error = err.toString()
0 commit comments