• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import {
2  memo,
3  __memo_context_type,
4  __memo_id_type,
5  State,
6  StateDecoratedVariable,
7  MutableState,
8  stateOf,
9  observableProxy
10} from '@ohos.arkui.stateManagement' // should be insert by ui-plugins
11
12import {
13  $r,
14  LengthMetrics,
15  Entry,
16  Builder,
17  PopInfo,
18  SheetOptions,
19  BlurStyleActivePolicy,
20  SheetSize,
21  SheetMode,
22  AdaptiveColor,
23  NavBarPosition,
24  NavDestinationCustomTitle,
25  Resource,
26  ResourceStr,
27  CustomBuilder,
28  BlurStyle,
29  AnimateParam,
30  ResourceColor,
31  NavigationAnimatedTransition,
32  NavigationTransitionProxy,
33  NavContentInfo,
34  NavigationOperation,
35  NavigationTitleOptions,
36  NavigationInterception,
37  NavigationCustomTitle,
38  ToolbarItemStatus,
39  Callback,
40  Text,
41  ToolbarItem,
42  TextAttribute,
43  SymbolGlyphModifier,
44  BarStyle,
45  Image,
46  Color,
47  Row,
48  Column,
49  NavDestinationCommonTitle,
50  Component,
51  Button,
52  ButtonAttribute,
53  Scroll,
54  ClickEvent,
55  UserView,
56  Curve,
57  NavPathStack,
58  Navigation,
59  LayoutSafeAreaEdge,
60  LaunchMode,
61  NavigationMenuItem,
62  NavPathInfo,
63  NavDestination,
64  LayoutSafeAreaType,
65  NavigationMode,
66  NavigationOptions,
67  NavigationTitleMode,
68  NavigationCommonTitle,
69  NavDestinationMode,
70  NavDestinationContext,
71  NavDestination,
72  NavPathStack,
73  NavDestinationContext,
74  Callback
75} from '@ohos.arkui.component'  // TextAttribute should be insert by ui-plugins
76
77import hilog from '@ohos.hilog'
78import { UIContext } from '@ohos.arkui.UIContext'
79
80import { routerParam, NavigationParam, pathStack } from './BaseDataMode'
81
82@Component
83export struct PageTwo {
84  build() {
85    NavDestination() {
86      Column(undefined) {
87        Button('replacePath pageOne').onClick((e?: ClickEvent) => {
88          let info: NavPathInfo = new NavPathInfo('pageOne', new NavigationParam('pageOne '))
89          pathStack.replacePath(info, {animated: true} as NavigationOptions)
90        })
91      }
92    }
93    .title('PageTwo')
94  }
95}
96
97@Component
98export struct PageOne {
99  build() {
100    NavDestination() {
101      Column(undefined) {
102        Text('Text测试')
103          .fontSize(12)
104      }
105    }
106    .title('PageOne')
107  }
108}
109
110@Entry
111@Component
112export struct NavigationTest {
113  build() {
114    NavDestination() {
115      Column(undefined) {
116        Button('push path pageTwo').onClick((e?: ClickEvent) => {
117          let info: NavPathInfo = new NavPathInfo('pageTwo', new NavigationParam('pageTwo'))
118          pathStack.pushPath(info, undefined)
119        })
120      }
121    }
122    .title('导航类组件测试001')
123  }
124}
125
126