我正在研究一个新的 CRM 项目,我在文档中找到了这个:https://nova.laravel.com/docs/4.0/installation.html#disabling-nova-s-theme-switcher这将删除切换按钮,但会将页面默认为 OS 设置。
在我的情况下,我通过在 Nova 引导方法中包含一个脚本来实现这一点,该脚本强制使用灯光主题。
引导方法:
public function boot()
{
parent::boot();
Nova::remoteScript(et('<dir/file>.js')); // this will include the script
Nova::withoutThemeSwitcher(); // this method disables the theme switcher
}
Javascript 代码:
localStorage.setItem("novaTheme","light"); // set theme to 'light' in localStorage
document.documentElement.clList.remove("dark"); // remove the dark cl from the document
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(64条)