Not sure which parts are fighting. All the libraries you’re loading or the custom code for the component.
First I’d try to load libraries only once. For example, you probably only need one copy of bootstrap.
Second, if its the component code that’s fighting (eg main-header) you can add scoped to your Vue Style tags. This makes the styling AND classes unique to that component.
However, I’m not sure what will happen if you make all those imports scoped to the component as well.
I think you’re better off, loading all those library components into the whole Vue project (import into main.js) instead of in the component itself. That way you can conditionally load things depending on the environment you’re using.
Problem :
I am working with laravel app that renders the Vuejs component into blade laravel, it renders the component but it’s affected with CSS design of laravel backend cause I preview the component in the backend part, my question is how can I split the CSS design of my Vuejs component from laravel CSS design backend?
So my question how could I split the design between backend and frontend(Vuejs components)?
any Idea or tips, I will be appreciated.
Comments
Comment posted by Omda
Thank you @Darick, as you said I follow
Comment posted by Potato Science
You just really need to isolate your layouts and make sure that your frontend styling doesn’t affect your backend. Are you reusing your components on your backend?
Comment posted by Omda
No, I just need to edit my theme through the backend and preview the theme in the backend to update logo, menus, contact us, and so on.
Comment posted by Potato Science
You can merge the styles you needed in the backend. “` mix.styles([‘resources/css/backend.css’, ‘resources/css/frontend.css’], ‘public/css/backend.css’) “` If you’re doing a preview of your frontend from the backend side of your application. You might want to do this.
Comment posted by Potato Science
Is there a way I can visualize what you are doing right now. I’ll gladly help
Comment posted by Omda
Thank you for a reply but I couldn’t get you @Bryce Howitson