Blazor提取出Razor类库,没有css的class的智能提示

最开始从stackoverflow上找到了答案,有两种办法,但都不太理想

后来自己找了新的办法,其实很简单,把要用的css复制到Razor类库的wwwroot文件夹中,默认是不会复制到引用Razor类库的项目中,如果想要复制的话,在引用Razor类库的项目的wwwroot下的index.html中添加

<link href="_content/你的Razor类库名/你的Razor类库名.bundle.scp.css" rel="stylesheet" />

参考文献

https://stackoverflow.com/questions/70735285/blazor-razor-class-library-rcl-no-css-intellisense?r=SearchResults

https://stackoverflow.com/questions/73993992/how-do-i-get-css-variable-intellisense-within-blazor-css-isolation-files?noredirect=1

https://learn.microsoft.com/zh-cn/aspnet/core/blazor/components/css-isolation?view=aspnetcore-6.0#razor-class-library-rcl-support

posted @   Yu-Core  阅读(139)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示