feat:navigator add extra
This commit is contained in:
parent
7d83431d68
commit
59acec6595
@ -1,8 +1,11 @@
|
|||||||
import { Panel, scroller, vlayout, text, layoutConfig, LayoutSpec, Color, gravity, IVLayout, Group, IText, navigator } from "doric";
|
import { Panel, scroller, vlayout, text, layoutConfig, LayoutSpec, Color, gravity, IVLayout, Group, IText, navigator, modal } from "doric";
|
||||||
import { colors, label } from "./utils";
|
import { colors, label } from "./utils";
|
||||||
@Entry
|
@Entry
|
||||||
class NaivgatorDemo extends Panel {
|
class NaivgatorDemo extends Panel {
|
||||||
build(root: Group) {
|
build(root: Group) {
|
||||||
|
if (this.getInitData()) {
|
||||||
|
modal(context).alert(`Init Data :${JSON.stringify(this.getInitData())}`)
|
||||||
|
}
|
||||||
scroller(vlayout([
|
scroller(vlayout([
|
||||||
text({
|
text({
|
||||||
text: "Navigator Demo",
|
text: "Navigator Demo",
|
||||||
@ -25,7 +28,12 @@ class NaivgatorDemo extends Panel {
|
|||||||
textColor: Color.WHITE,
|
textColor: Color.WHITE,
|
||||||
layoutConfig: layoutConfig().exactly().w(LayoutSpec.AT_MOST),
|
layoutConfig: layoutConfig().exactly().w(LayoutSpec.AT_MOST),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
navigator(context).push(`assets://demo/${e}.js`, `${e}.js`)
|
navigator(context).push(`assets://demo/${e}.js`, {
|
||||||
|
alias: `${e}.js`,
|
||||||
|
extra: {
|
||||||
|
from: "navigatorDemo"
|
||||||
|
},
|
||||||
|
})
|
||||||
},
|
},
|
||||||
} as IText)
|
} as IText)
|
||||||
),
|
),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, stack, hlayout, text, IHLayout, CENTER, slider, slideItem, modal, Slider, Text, Color, View, Stack, animate, flowlayout, FlowLayoutItem, NestedSlider } from "doric";
|
import { Panel, Group, scroller, vlayout, image, layoutConfig, LayoutSpec, Input, Gravity, log, stack, hlayout, text, IHLayout, CENTER, slider, slideItem, modal, Slider, Text, Color, View, Stack, animate, flowlayout, FlowLayoutItem, NestedSlider, ScaleType } from "doric";
|
||||||
import { title, colors } from "./utils";
|
import { title, colors } from "./utils";
|
||||||
|
|
||||||
function tab(idx: number, title: string, sliderView: Slider) {
|
function tab(idx: number, title: string, sliderView: Slider) {
|
||||||
@ -25,7 +25,14 @@ class StickDemo extends Panel {
|
|||||||
|
|
||||||
scroller(
|
scroller(
|
||||||
vlayout([
|
vlayout([
|
||||||
stack([]).apply({
|
stack([
|
||||||
|
image({
|
||||||
|
layoutConfig: layoutConfig().atmost(),
|
||||||
|
imageUrl: "https://p.upyun.com/demo/webp/webp/jpg-0.webp",
|
||||||
|
scaleType: ScaleType.ScaleAspectFill,
|
||||||
|
}),
|
||||||
|
|
||||||
|
]).apply({
|
||||||
layoutConfig: layoutConfig().atmost().h(LayoutSpec.EXACTLY),
|
layoutConfig: layoutConfig().atmost().h(LayoutSpec.EXACTLY),
|
||||||
height: 200,
|
height: 200,
|
||||||
backgroundColor: colors[0],
|
backgroundColor: colors[0],
|
||||||
|
Reference in New Issue
Block a user