diff --git a/src/NavigatorDemo.ts b/src/NavigatorDemo.ts index 03796ef5..b5ae7eca 100644 --- a/src/NavigatorDemo.ts +++ b/src/NavigatorDemo.ts @@ -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"; @Entry class NaivgatorDemo extends Panel { build(root: Group) { + if (this.getInitData()) { + modal(context).alert(`Init Data :${JSON.stringify(this.getInitData())}`) + } scroller(vlayout([ text({ text: "Navigator Demo", @@ -25,7 +28,12 @@ class NaivgatorDemo extends Panel { textColor: Color.WHITE, layoutConfig: layoutConfig().exactly().w(LayoutSpec.AT_MOST), 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) ), diff --git a/src/StickDemo.ts b/src/StickDemo.ts index 433609ae..43d9b3b6 100644 --- a/src/StickDemo.ts +++ b/src/StickDemo.ts @@ -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"; function tab(idx: number, title: string, sliderView: Slider) { @@ -25,7 +25,14 @@ class StickDemo extends Panel { scroller( 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), height: 200, backgroundColor: colors[0],