HTML `data-*` Attributes Not Accessible in JavaScript When Using Vue 3 with Hot Reloading
I'm a bit lost with I'm a bit lost with I'm a bit lost with I'm working on a project and hit a roadblock. I've been struggling with this for a few days now and could really use some help. I'm experiencing an scenario with Vue 3 where `data-*` attributes in my HTML elements become inaccessible in JavaScript after making changes during development. I have a simple component that's supposed to read a `data-user-id` attribute from a button element, but after a hot reload, the value is always `undefined`. Here's the relevant code snippet: ```html <template> <button :data-user-id="userId" @click="handleClick">Click Me</button> </template> <script> export default { data() { return { userId: 12345 } }, methods: { handleClick(event) { const userId = event.currentTarget.getAttribute('data-user-id'); console.log(userId); // Logs undefined after hot reload } } } </script> ``` I have tried changing the `data-*` attribute to a regular attribute and accessing it directly from the Vue instance's data, but that doesn't seem to fix the scenario either. This seems to only happen when I make an edit to the component, and Vue's hot reloading kicks in. I also verified that the `userId` is correctly set before the button click. Could this be a bug with Vue's reactivity system or something related to how hot reloading works? Any suggestions on how to ensure the `data-*` attributes are accessible after hot reloading? My development environment is Linux. Any ideas what could be causing this? This is part of a larger web app I'm building. Thanks in advance! I'm working on a application that needs to handle this. Any ideas how to fix this? Thanks, I really appreciate it! Any examples would be super helpful.