Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.22 KB

no-watch-after-await.md

File metadata and controls

49 lines (35 loc) · 1.22 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-watch-after-await
disallow asynchronously registered `watch`

vue/no-watch-after-await

disallow asynchronously registered watch

  • ⚙️ This rule is included in all of "plugin:vue/vue3-essential", "plugin:vue/vue3-strongly-recommended" and "plugin:vue/vue3-recommended".

📖 Rule Details

This rule reports the watch() after await expression.
In setup() function, watch() should be registered synchronously.

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

    await doSomething()

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

🔧 Options

Nothing.

📚 Further reading

🔍 Implementation