init project structure

This commit is contained in:
clz 2024-09-08 21:51:27 +08:00
parent 17f8f49968
commit 406685b399
8 changed files with 80 additions and 21 deletions

View File

@ -0,0 +1,4 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.components.home

View File

@ -0,0 +1,4 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.components.home

View File

@ -0,0 +1,4 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.components.home

View File

@ -1,20 +1,10 @@
package ohos_app_cangjie_entry package ohos_app_cangjie_entry
internal import ohos.base.LengthProp internal import ohos.base.*
internal import ohos.component.Column internal import ohos.component.*
internal import ohos.component.Row internal import ohos.state_manage.*
internal import ohos.component.Button import ohos.state_macro_manage.*
internal import ohos.component.Text import ohos_app_cangjie_entry.pages.*
internal import ohos.component.CustomView
internal import ohos.component.CJEntry
internal import ohos.component.loadNativeView
internal import ohos.state_manage.SubscriberManager
internal import ohos.state_manage.ObservedProperty
internal import ohos.state_manage.LocalStorage
import ohos.state_macro_manage.Entry
import ohos.state_macro_manage.Component
import ohos.state_macro_manage.State
import ohos.state_macro_manage.r
@Entry @Entry
@Component @Component
@ -24,11 +14,8 @@ class MyView {
func build() { func build() {
Row { Row {
Column { HomePage()
Button(message).onClick { SidePage()
evt => AppLog.info("Hello Cangjie") }.height(100.percent).width(100.percent)
}.fontSize(40).height(80)
}.width(100.percent)
}.height(100.percent)
} }
} }

View File

@ -0,0 +1,21 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.pages
internal import ohos.base.*
internal import ohos.component.*
internal import ohos.state_manage.*
import ohos.state_macro_manage.*
import ohos_app_cangjie_entry.utils.Logger
@Component
public class HomePage {
private let TAG = "HomePage"
protected func aboutToAppear() {
Logger(TAG).info("aboutToAppear")
}
func build() {
Row()
}
}

View File

@ -0,0 +1,21 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.pages
internal import ohos.base.*
internal import ohos.component.*
internal import ohos.state_manage.*
import ohos.state_macro_manage.*
import ohos_app_cangjie_entry.utils.Logger
@Component
public class SidePage {
private let TAG: String = "SidePage"
protected func aboutToAppear() {
Logger(this.TAG).info("aboutToAppear")
}
func build() {
Row()
}
}

View File

@ -0,0 +1,18 @@
/**
* Created on 2024/9/8
*/
package ohos_app_cangjie_entry.utils
public class Logger {
private let TAG: String
public init(TAG: String) {
this.TAG = TAG + ": "
}
public func debug(msg: String) {}
public func error(msg: String) {}
public func info(msg: String) {}
public func warn(msg: String) {}
}