You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is that any way to shared a global var and function of parent to all child components?
Not by prop and inherit.
For example, I want to define my general output error function to log the promise catch error, but I have to import this output error function from helper.js in all components. When the page system is huge, it is hard to maintain. What I want is define a global var or method in parent, all child components can use it.
Now my temporary solution is to user webpack-stream or gulp to package the helper.js with main file. But should there be a way in Vue to manage the global var and function in the component symtem?