大餐中的手机和桌面页面的样式如何分配?
我需要将大餐中不同的.CSS文件拆分为根据设备的页面中的标题中的一个。但是我可以知道仅在我的.Razor页面上询问了哪种类型的设备:
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
isMobile = await JsRuntime.InvokeAsync<bool>("isMobile");
await generateCaptcha();
}
}
我可以将剃须刀页面的样式包含在标题上吗?还是我还能使用哪些其他方法来解决它?
I need to split styles by different .css files in Blazor to only one of them includes in header depending device's page. But I can know which type of device is asked my page only on my .razor page:
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
isMobile = await JsRuntime.InvokeAsync<bool>("isMobile");
await generateCaptcha();
}
}
Can I include styles from my razor page to header? Or what other methods can I use for resolve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经从组件中调用JS,只需添加,更改或删除任何DOM元素即可。您的另一个选项可能是动态更改CSS内容whit
@import
You are already calling js from your component, you can just add, change or remove any dom element from there. Another option for you may be to dynamically change the CSS content whit
@import