how I can dynamicaly load CSS file on VueJS (SPA) application?
Short scenario
- Application starts and submit request to backend server for CSS file name by url address
- Apllication get response from backend server with css filename params
Then i need call something whats load new CSS file by response data.
We used this for web-site branding (CSS are depends on actual domain - but site is installed on one hosting). This CSS file can be located on our server (/assets/css/xx.css) or on other servers.
Short snippet from Vue component:
loadCssRequest(location.href).then(function(reponse){
// something whats load css by response.css_code
});
Thanks for any ideas.