When it comes to loading style sheets in Vue, what is considered the most effective method for placement?
Should code or style sheets be loaded within the components that utilize them, or is it more favorable to load the resource in the parent page/containing component?
For instance, imagine we have a single legacy js script named baz.js
that needs to be used by component Foo
. The parent of component Foo is known as Profile
(which represents the user's profile page). In this scenario, would it be preferable to load baz.js
in Profile
, or should it be loaded in Foo
instead?
I have observed both approaches being used, but I am uncertain of the advantages each approach offers and which one would be better suited for specific situations. Is there a definitive "correct" approach in this context?