Skip to content
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

onMounted doesn't work correct #13678

Closed
danis-arslanov opened this issue Apr 11, 2022 · 1 comment
Closed

onMounted doesn't work correct #13678

danis-arslanov opened this issue Apr 11, 2022 · 1 comment

Comments

@danis-arslanov
Copy link

danis-arslanov commented Apr 11, 2022

Environment

  • Operating System: Windows_NT
  • Node Version: v14.18.2
  • Nuxt Version: 3.0.0-27487080.ec32cf9
  • Package Manager: yarn@1.22.17
  • Builder: vite
  • User Config: meta, css, build, ssr, vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

<template> <div ref="test">Test</div> </template>

const test = ref(null); onMounted(() => { console.log(test.value.offsetWidth); });

Describe the bug

When changing the route, console.log outputs offsetWidth = 0, when the page is reloaded normally, offsetWidth works.

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

Let's track this in #13471.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants