Lifecycle Hook Registration (ARCH3323)
هذا المحتوى غير متوفر بلغتك بعد.
Key typescript.vue.lifecycle-registration · Severity error · Category quality
Vue: flags onMounted and friends registered conditionally or after an await. Vue binds lifecycle hooks to the component being set up at that moment, so the hook never runs.
Incorrect
Section titled “Incorrect”<script setup lang="ts">const settings = await loadSettings();onMounted(() => focusSearch());</script>Correct
Section titled “Correct”<script setup lang="ts">onMounted(() => focusSearch());const settings = await loadSettings();</script>