success call entity method
This commit is contained in:
@@ -16,7 +16,7 @@ layout.space = 10
|
||||
console.log(layout.viewId)
|
||||
console.log(layout.toModel())
|
||||
|
||||
@Registor
|
||||
@Registor(context)
|
||||
export class MyPage extends Panel {
|
||||
build() {
|
||||
return layout
|
||||
|
@@ -1,4 +1,5 @@
|
||||
export * from "./src/ui/view"
|
||||
export * from "./src/ui/panel"
|
||||
export * from "./src/util/color"
|
||||
export * from './src/util/log'
|
||||
export * from './src/util/log'
|
||||
export * from './src/runtime/global'
|
@@ -1,12 +1,13 @@
|
||||
import { View } from "./view";
|
||||
import { } from '../runtime/global'
|
||||
|
||||
export function Registor<T extends { new(...args: any[]): {} }>(constructor: T) {
|
||||
const ret = class extends constructor {
|
||||
context = context
|
||||
export function Registor(context: any) {
|
||||
return <T extends { new(...args: any[]): {} }>(constructor: T) => {
|
||||
const ret = class extends constructor {
|
||||
context = context
|
||||
}
|
||||
context.register(new ret)
|
||||
return ret
|
||||
}
|
||||
context.register(new ret)
|
||||
return ret
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user