This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/js-framework/demo.ts

29 lines
680 B
TypeScript
Raw Normal View History

2019-07-22 13:52:30 +08:00
import { NativeCall, Text, Alignment, Color, VLayout, Panel, log, logw, loge } from "./index"
2019-07-18 16:29:24 +08:00
2019-07-18 20:11:01 +08:00
2019-07-22 13:41:38 +08:00
@Entry
2019-07-18 16:29:24 +08:00
export class MyPage extends Panel {
build() {
2019-07-22 13:41:38 +08:00
return new Text
2019-07-18 16:29:24 +08:00
}
2019-07-22 13:41:38 +08:00
@NativeCall
2019-07-18 16:29:24 +08:00
log() {
2019-07-22 13:41:38 +08:00
log("Hello.HEGO")
logw("Hello.HEGO")
loge("Hello.HEGO")
2019-07-22 11:22:19 +08:00
context.bridge.demo_testPromise(true).then((r) => {
log('resolve', r)
}, (e) => {
log('reject', e)
})
context.bridge.demo_testPromise(false).then((r) => {
log('resolve', r)
}, (e) => {
log('reject', e)
})
2019-07-22 13:41:38 +08:00
setTimeout(function () {
log('settimeout')
}, 1000)
2019-07-18 16:29:24 +08:00
}
}