CSS from Blazor Component Lib not loaded

江枫思渺然 提交于 2020-07-06 19:59:57

问题


I want to use my customs CSS located on the wwwroot/css/. in my BlazorControllers/Components/. files but nothing is loaded at execution. Is there something to specify in the client or in the lib project settings ?

My Library project is BlazorControllers and I use the component of the library in the Client project


回答1:


In your Index.html (or _Host.cshtml) file, below the site.css line, add

<link href="_content/<YourLibrary>/styles.css" rel="stylesheet" />

where <YourLibrary> seems to be BlazorControllers in your case.

And when I read that picture right you (also) need

<link href="_content/BlazorControllers/css/MyComponents.css" rel="stylesheet" />


来源:https://stackoverflow.com/questions/59609028/css-from-blazor-component-lib-not-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!