mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui-next: refactor plugin loader (#1190)
This commit is contained in:
1 parent
0e688f77b7
commit
f9cd5bcb40
12 files changed
+181
-17
No files matched your search
@@ -1,9 +1,8 @@
|
||||
import type { PluginAPI } from '@hydrooj/ui-next';
|
||||
|
||||
export function setup(api: PluginAPI) {
|
||||
api.before('page:app', () => {
|
||||
console.log('before app');
|
||||
// throw new Error('test error boundary in before interceptor');
|
||||
return <div>before app via @hydrooj/ui-next-plugin-sample</div>;
|
||||
});
|
||||
// (2) Page registration — slot names match the server route names / template stems
|
||||
// registered in ../index.ts. Pages are lazy-loaded on demand.
|
||||
api.registerPage('example_home', () => import('./pages/example_home'));
|
||||
api.registerPage('example_css', () => import('./pages/example_css'));
|
||||
}
|
||||
Reference in new issue
Block a user