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 Length, 22 NavDestination, 23 NavPathStack, 24 NavDestinationContext, 25 Callback, 26 PixelMap, 27 Image, 28 ImageAttribute, 29 Circle, 30 CircleOptions, 31 CircleAttribute, 32 Ellipse, 33 EllipseOptions, 34 EllipseAttribute, 35 Rect, 36 RectOptions, 37 RectAttribute, 38 Path, 39 PathOptions, 40 PathAttribute, 41 CanvasAttribute, 42 VoidCallback, 43 Canvas, 44 CanvasRenderingContext2D, 45 RenderingContextSettings, 46 Scroll, 47 ScrollOptions, 48 ScrollAttribute, 49 Line, 50 LineOptions, 51 LineAttribute, 52 LineCapStyle, 53 LineJoinStyle, 54 Shape, 55 ShapeAttribute, 56 PolygonOptions, 57 PolygonAttribute, 58 Polygon, 59 Polyline, 60 PolylineOptions, 61 PolylineAttribute 62} from '@ohos.arkui.component' // TextAttribute should be insert by ui-plugins 63 64import hilog from '@ohos.hilog' 65 66@Component 67export struct ShapeTest { 68 @State stateVar: string = 'state var'; 69 message: string = 'var'; 70 changeValue() { 71 this.stateVar+='~' 72 } 73 @State f: boolean = false; 74 75 build() { 76 NavDestination() { 77 Column(undefined) { 78 Text(this.stateVar) 79 80 Circle({ width: 100, height: 80 } as CircleOptions).fill(0xff00ff00) 81 82 Ellipse({ width: '400vp', height: 80 }).fill(0xff00ff00) 83 84 Rect({ width: 150, height: 80 } as RectOptions) 85 .fill(0xff00ff00) 86 } 87 } 88 .title('Shape组件基础功能测试用例') 89 } 90} 91 92@Component 93struct Child { 94 @State stateVar: string = 'Child'; 95 build() { 96 Text(this.stateVar).fontSize(50) 97 } 98} 99