In my vue project I have a default image that should show up in places around the app when an image is missing or hasn’t been uploaded yet. I have various class files and component calls that want to use the same image.
What is the best way to create a global variable that I can access from anywhere? I can’t put it in the store because my class files (I’m using vuex-orm) are loaded before the store is declared. I would prefer not to put it in the window
because I want to have a single word variable that I can call (defaultImg
as opposed to window.my_project.globals.defaultImg
). I could put it in .env but I want this to be checked into the repository and the same across environments so that doesn’t seem right either.
What is the best way to provide a simple global string to all files in my vue project?