diff --git a/arkoala-arkts/trivial/user/src/ets/page2.ets b/arkoala-arkts/trivial/user/src/ets/page2.ets index 1be753eae7e030d42f2f26eec947614aa9c3ca3e..0a4485ba1e2ceb54e7c888a4706fe52de2c41140 100644 --- a/arkoala-arkts/trivial/user/src/ets/page2.ets +++ b/arkoala-arkts/trivial/user/src/ets/page2.ets @@ -13,58 +13,12 @@ * limitations under the License. */ -import { Button, Column, ColumnOptions, ClickEvent, State, PageTransitionEnter, PageTransitionExit, PageTransitionOptions } from "@ohos.arkui" +import { C } from "./page3" -import router from '@ohos.router' +export struct S { + x: number = 4 -function nLog(message: string) { - console.log(message) -} - -@Component -@Entry -struct Page2 { - @State value: number = 11 - onPageShow() { - nLog('Page2 onPageShow()') - } - - onPageHide() { - nLog('Page2 onPageHide()') - } - - aboutToAppear() { - nLog('Page2 aboutToAppear()') - } - - aboutToDisappear() { - nLog('Page2 aboutToDisappear()') - } - build() { - nLog(`In Page2 build()`) - Column({}) { - Button("Click") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - this.value++ - nLog(`Page2: clicked ${this.value}`) - }) - Button("Back") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - nLog(`Page2: back clicked`) - router.back() - }) - } - } - - @Builder - pageTransition() { - // TODO: now lambda type inference cannot handle literal wrapping. - PageTransitionEnter({ duration: 100 } as PageTransitionOptions) - PageTransitionExit({ duration: 100 } as PageTransitionOptions) + m() { + this.x = 19 } } - diff --git a/arkoala-arkts/trivial/user/src/ets/page3.ets b/arkoala-arkts/trivial/user/src/ets/page3.ets index 4e2e904438218e6a04e14ee0c9c4184d6e995f3f..a52eb52a8d98f8cfdc7423e17e425b0d9e60629f 100644 --- a/arkoala-arkts/trivial/user/src/ets/page3.ets +++ b/arkoala-arkts/trivial/user/src/ets/page3.ets @@ -1,69 +1,5 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +import { S } from "./page2" -import router from '@ohos.router' -import { Button, Column, ColumnOptions, ClickEvent, State, PageTransitionEnter, PageTransitionExit, PageTransitionOptions } from "@ohos.arkui" +export class C { -function nLog(message: string) { - console.log(message) } - -@Component -@Entry -struct Page3 { - @State value: number = 11 - onPageShow() { - nLog('Page3 onPageShow()') - } - - onPageHide() { - nLog('Page3 onPageHide()') - } - - aboutToAppear() { - nLog('Page3 aboutToAppear()') - } - - aboutToDisappear() { - nLog('Page3 aboutToDisappear()') - } - build() { - nLog(`In Page3 build()`) - Column({}) { - Button("Click") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - this.value++ - nLog(`Page3: clicked ${this.value}`) - }) - Button("Go") - .width(200).height(100) - .backgroundColor('#ff0000') - .onClick((e?: ClickEvent) => { - nLog(`Page3: Go clicked`) - router.push({ url: "page2" }) - }) - } - } - - @Builder - pageTransition() { - // TODO: now lambda type inference cannot handle literal wrapping. - PageTransitionEnter({ duration: 100 } as PageTransitionOptions) - PageTransitionExit({ duration: 100 } as PageTransitionOptions) - } -} - diff --git a/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts b/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts index f73298098df1dbaa1b686b0a4fa05052ae7fd844..1e2f5fd81b2da67bbb0e6c83f053b9832e2c7e75 100644 --- a/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts +++ b/ui2abc/libarkts/src/arkts-api/ProgramProvider.ts @@ -30,6 +30,8 @@ export class ProgramProvider { const listed = listPrograms(this.mainProgram.program, this.filter) for (const program of listed) { if (!this.seenPrograms.has(program.program.peer)) { + if (!program.name.includes("page2") && !program.name.includes("page3")) continue + console.log(program.name) this.seenPrograms.add(program.program.peer) this.queue.push(program) }