• 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  Text,
14  TextAttribute,
15  Column,
16  Component,
17  Button,
18  ButtonAttribute,
19  ClickEvent,
20  UserView,
21  TextInput,
22  TextInputController,
23  TextArea,
24  TextAreaController,
25  Color,
26  CopyOptions,
27  InputType,
28  UnderlineColor,
29  IconOptions,
30  CancelButtonOptions,
31  CancelButtonStyle,
32  FontWeight,
33  TextMenuItem,
34  Resource,
35  EditMenuOptions,
36  TextRange,
37  TextMenuItemId,
38  EllipsisMode,
39  TextOverflow,
40  TextAlign,
41  LengthMetrics,
42  TextDecorationType,
43  TextDecorationOptions,
44  TextDecorationStyle,
45  DecorationStyleInterface,
46  Font,
47  FontStyle,
48  ShadowOptions,
49  Callback,
50  TextCase,
51  TextHeightAdaptivePolicy,
52  WordBreak,
53  TextSelectableMode,
54  LineBreakStrategy,
55  MarqueeState,
56  MarqueeStartPolicy,
57  TextMarqueeOptions,
58  ObscuredReasons,
59  TextDataDetectorType,
60  Builder,
61  Menu,
62  Span,
63  ImageSpan,
64  TextSpanType,
65  TextResponseType,
66  MenuItemGroup,
67  ImageFit,
68  ImageSpanAlignment,
69  TextController,
70  TextOptions,
71  MenuItem,
72  MenuItemOptions,
73  TextRange,
74  StyledStringValue,
75  DecorationStyle,
76  StyleOptions,
77  StyledString,
78  StyledStringKey,
79  TextStyle,
80  TextContentControllerOptions,
81  EditableTextChangeValue,
82  Margin,
83  Search,
84  SearchOptions,
85  Marquee,
86  MarqueeUpdateStrategy,
87  MarqueeOptions,
88  TextMenuShowMode,
89  SymbolGlyph,
90  NavDestination,
91  NavPathStack,
92  NavDestinationContext,
93  Callback
94} from '@ohos.arkui.component'  // TextAttribute should be insert by ui-plugins
95
96import hilog from '@ohos.hilog'
97import { $r } from 'arkui.component.common'
98
99@Component
100export struct TextInputTest {
101  textAreaController: TextAreaController = new TextAreaController()
102  textInputController: TextInputController = new TextInputController()
103
104  build() {
105    NavDestination() {
106      Column(undefined) {
107
108        Text('TextInput测试')
109          .fontSize(12)
110          .textAlign(TextAlign.Center)
111          .margin({
112            bottom: 0,
113            top: 30,
114            left: 0,
115            right: 0
116          } as Margin)
117        TextInput({
118          placeholder: 'input your word...',
119          controller: this.textInputController
120        })
121      }
122    }
123    .title('TextInput文本输入框用例001')
124  }
125}
126
127@Component
128struct Child {
129  @State stateVar: string = 'Child';
130  build() {
131    Text(this.stateVar).fontSize(50)
132  }
133}
134