Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.1 KB

no-computed-properties-in-data.md

File metadata and controls

45 lines (34 loc) · 1.1 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-computed-properties-in-data
disallow accessing computed properties in `data`.

vue/no-computed-properties-in-data

disallow accessing computed properties in data.

  • This rule has not been released yet.

📖 Rule Details

This rule disallow accessing computed properties in data().
The computed property cannot be accessed in data() because is before initialization.

<script>
export default {
  data() {
    return  {
      /* ✗ BAD */
      bar: this.foo
    }
  },
  computed: {
    foo () {}
  }
}
</script>

🔧 Options

Nothing.

🔍 Implementation