fix bindContext

This commit is contained in:
srgooglo 2022-05-30 22:28:00 +02:00
parent c9c13e895c
commit b020f4018b

View File

@ -8,7 +8,7 @@ import NotFoundRender from "./staticsRenders/404"
import CrashRender from "./staticsRenders/crash" import CrashRender from "./staticsRenders/crash"
export const ConnectWithApp = (component) => { export const ConnectWithApp = (component) => {
return window.app.bindContexts(component) return RenderCore.bindContexts(component)
} }
export function GetRoutesComponentMap() { export function GetRoutesComponentMap() {
@ -108,7 +108,7 @@ export class RenderCore extends Core {
progressBar = progressBar.configure({ parent: "html", showSpinner: false }) progressBar = progressBar.configure({ parent: "html", showSpinner: false })
publicMethods = { publicMethods = {
setLocation: this.ctx.history.setLocation, bindContexts: RenderCore.bindContexts,
} }
initialize = () => { initialize = () => {
@ -138,6 +138,8 @@ export class RenderCore extends Core {
this.ctx.history.lastLocation = this.history.location this.ctx.history.lastLocation = this.history.location
}, delay ?? defaultTransitionDelay) }, delay ?? defaultTransitionDelay)
} }
this.ctx.registerPublicMethod("setLocation", this.publicMethods.setLocation)
} }
validateLocationSlash = (location) => { validateLocationSlash = (location) => {
@ -150,7 +152,7 @@ export class RenderCore extends Core {
return key return key
} }
bindContexts = (component) => { static bindContexts = (component) => {
let contexts = { let contexts = {
main: {}, main: {},
app: {}, app: {},