I'm working on a container with various elements like h1, p, etc. The container has a background and I'm trying to create a method to move it based on mouse coordinates. However, I'm facing an issue where the e.target is showing me elements inside the container instead of the actual container itself. Any ideas on how to access the container element directly?
Is there a way to share functions between the main component and child components more efficiently? Currently, I have to add :moveHero="moveHero" to every component in order to access a specific method. I'm looking for a global solution where I can define this once and easily share it with all child components. Would creating a .js file and importing it into Vue be a viable option?