Nova 4 e:强制黑暗或光明模式laravelnova4

我正在研究一个新的 CRM 项目,我在文档中找到了这个:https://nova.laravel.com/docs/4.0/installation.html#disabling-nova-s-theme-switcher这将删除切换按钮,但会将页面默认为 OS 设置。

1

在我的情况下,我通过在 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

本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处

(690)
表格里面的表格 可以吗(define alright)
上一篇
软件培训php:PHP代码被报告为恶意软件(post.php virus)
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(64条)