Skip to content

Files

Latest commit

 

History

History
38 lines (26 loc) · 944 Bytes

no-lifecycle-after-await.md

File metadata and controls

38 lines (26 loc) · 944 Bytes

Pattern: Use of life-cycle hook after await

Issue: -

Description

This rule reports the life-cycle hooks after await expression.
In setup() function, onXXX life-cycle hooks should be registered synchronously.

<script>
import { onMounted } from 'vue'
export default {
  async setup() {
    /* ✓ GOOD */
    onMounted(() => { /* ... */ })

    await doSomething()

    /* ✗ BAD */
    onMounted(() => { /* ... */ })
  }
}
</script>

📚 Further Reading

Further Reading