diff --git a/arkoala-arkts/arkui/src/sts/arkui.sts b/arkoala-arkts/arkui/src/sts/arkui.sts index 06e96582ceba2387cb9fed2d7be6e0e83f046420..69aa97eceb68694645131f7c72d189853e4f7c1e 100644 --- a/arkoala-arkts/arkui/src/sts/arkui.sts +++ b/arkoala-arkts/arkui/src/sts/arkui.sts @@ -52,6 +52,10 @@ export class CommonMethod { console.log(`.width(${value})`) return this } + height(value: number): this { + console.log(`.height(${value})`) + return this + } } // An attempt to put down a component @@ -90,7 +94,9 @@ export class Button extends CommonMethod { options?: ButtonOptions|string, //content?: () => void ): Button { - throw new Error("This method should only be called through a @BuilderLambda redirect") + //throw new Error("This method should only be called through a @BuilderLambda redirect") + console.log("Button") + return factory() } static instantiateImpl( @@ -117,7 +123,10 @@ export class Text extends CommonMethod { options?: TextOptions|string, //content?: () => void ): Text { - throw new Error("This method should only be called through a @BuilderLambda redirect") + //throw new Error("This method should only be called through a @BuilderLambda redirect") + + console.log("Text") + return factory() } // TODO: the second argument will be gone after hte plugin is improved @@ -134,7 +143,7 @@ export class Text extends CommonMethod { } fontColor(value: Color): this { - console.log(value) + console.log("\.fontColor(", Color[value], ")") return this } } diff --git a/arkoala-arkts/user/src/sts/hello.sts b/arkoala-arkts/user/src/sts/hello.sts index 6a41db84cc9c85e5bf7f3151d3dfd55b7dd99cd7..2bf90253cc3ab5996892f170f9fb4ea31831c301 100644 --- a/arkoala-arkts/user/src/sts/hello.sts +++ b/arkoala-arkts/user/src/sts/hello.sts @@ -17,12 +17,15 @@ struct MyStateSample { this.color = Color.Red }) - }).width(100) + }) + .width(100) + .height(300) + } } export class ArkUIEntry { - static mandatory: boolean = ArkUIEntry.run() + // static mandatory: boolean = ArkUIEntry.run() static run(): boolean { console.log("About to invoke the struct") // The proper call fails because of a compiler frontend bug.