Skip to content

Files

Latest commit

 

History

History
39 lines (25 loc) · 612 Bytes

no-this-in-fetch-data.md

File metadata and controls

39 lines (25 loc) · 612 Bytes

Pattern: Use of this in asyncData/fetch

Issue: -

Description

This rule is for preventing using this in asyncData/fetch.

Examples of incorrect code for this rule:

export default {
  ...foo,
  async asyncData() {
    if (this.$route.path === 'foo') {

    }
  }
}

Examples of correct code for this rule:

export default {
  ...foo,
  async asyncData() {
    // no this
  }
}

Further Reading