From 40ad0689dfb79a2d198ca1c97c111e153d9576c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F=E7=99=BD=E5=93=A6?= Date: Sat, 30 Aug 2025 22:48:00 +0800 Subject: [PATCH] Create index.js --- js/src/forum/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 js/src/forum/index.js diff --git a/js/src/forum/index.js b/js/src/forum/index.js new file mode 100644 index 0000000..f5fe69b --- /dev/null +++ b/js/src/forum/index.js @@ -0,0 +1,13 @@ +import { extend } from 'flarum/common/extend'; +import SettingsPage from 'flarum/forum/components/SettingsPage'; +import ThemeSwitcher from './components/ThemeSwitcher'; + +app.initializers.add('demo-theme-switcher', () => { + extend(SettingsPage.prototype, 'settingsItems', function (items) { + items.add( + 'theme-switcher', + , + 10 // 排序,越小越靠上 + ); + }); +});