All props of route, expose routerHook

This commit is contained in:
Jonas Dellinger
2022-05-30 20:55:51 +02:00
parent 007860f8f7
commit 8fcaadd8f3
5 changed files with 90 additions and 42 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ class PluginLoader extends Logger {
private async importReactPlugin(name: string) {
let res = await fetch(`http://127.0.0.1:1337/plugins/${name}/frontend_bundle`);
if (res.ok) {
let content = await eval(await res.text())(PluginLoader.createPluginAPI(name));
let content = await eval(await res.text())(this.createPluginAPI(name));
this.plugins.push({
name: name,
icon: content.icon,
@@ -82,7 +82,7 @@ class PluginLoader extends Logger {
});
}
static createPluginAPI(pluginName: string) {
createPluginAPI(pluginName: string) {
return {
routerHook: this.routerHook,
async callServerMethod(methodName: string, args = {}) {