New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuxtLayout breaks v-model behaviour when used after any async statement #26934
Comments
Start a new pull request in StackBlitz Codeflow. |
FYI: This does not happen when awaiting a <template>
<input v-model="a" />
<p>{{ a }}</p>
</template>
<script setup lang="ts">
const a = ref(1);
const myFunc = async () => {
await new Promise(r => setTimeout(r, 1000));
a.value = 2;
};
onBeforeMount(() => {
myFunc();
});
</script> |
@manniL I don't know about timeouts, but when I have real AJAX calls in my application it happens. |
hey 👋
Here Alex's video about it I can't reproduce the v-model issue |
@huang-julien Bro this bug has nothing to do with SSR, |
@sharifzadesina can you repro it with something else than nextTick? |
@manniL No, but in my own app, fetch calls also cause problems. |
Then please provide a reproduction without |
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a couple of templates for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
This issue was closed because it was open for 7 days without a reproduction. |
Environment
Reproduction
Checkout the project on Stackblitz:
https://stackblitz.com/edit/nuxt-starter-cjpm2f?file=app.vue
The input value should be 2, but it remains 1 if you remove the async statement or NuxtLayout, everything will be fixed.
Describe the bug
It seems something happens in NuxtLayout that breaks v-model behavior before mount and prevent it from updating the value of input. if you don't use any async statement or NuxtLayout, everything works fine.
Additional context
If you don't use v-model and use
:value
and@input
instead or just print the variable value, everything works file, only v-model is broken.Logs
No response
The text was updated successfully, but these errors were encountered: