init project structure
This commit is contained in:
parent
17f8f49968
commit
406685b399
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* Created on 2024/9/8
|
||||||
|
*/
|
||||||
|
package ohos_app_cangjie_entry.components.home
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* Created on 2024/9/8
|
||||||
|
*/
|
||||||
|
package ohos_app_cangjie_entry.components.home
|
4
entry/src/main/cangjie/src/components/home/HomeTitle.cj
Normal file
4
entry/src/main/cangjie/src/components/home/HomeTitle.cj
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* Created on 2024/9/8
|
||||||
|
*/
|
||||||
|
package ohos_app_cangjie_entry.components.home
|
0
entry/src/main/cangjie/src/components/side/.gitkeep
Normal file
0
entry/src/main/cangjie/src/components/side/.gitkeep
Normal 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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
21
entry/src/main/cangjie/src/pages/HomePage.cj
Normal file
21
entry/src/main/cangjie/src/pages/HomePage.cj
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
21
entry/src/main/cangjie/src/pages/SidePage.cj
Normal file
21
entry/src/main/cangjie/src/pages/SidePage.cj
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
18
entry/src/main/cangjie/src/utils/Log.cj
Normal file
18
entry/src/main/cangjie/src/utils/Log.cj
Normal 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) {}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user