1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16@Entry 17@Component 18struct GridRowSample2 { 19 @State currentBreakpoint: string = 'md' 20 21 build() { 22 SideBarContainer(SideBarContainerType.Embed) { 23 Column() { 24 } 25 .width('100%') 26 .backgroundColor('#19000000') 27 28 GridRow({ breakpoints: { value: ['100vp', '200vp', '300vp', '400vp', '500vp'], 29 reference: BreakpointsReference.ComponentSize } }) { 30 GridCol({ 31 span: { 32 xs: 12, 33 sm: 12, 34 md: 12, 35 lg: 12, 36 xl: 12, 37 xxl: 12 38 } 39 }) { 40 Row() { 41 Text(this.currentBreakpoint) 42 .fontSize(50) 43 .fontWeight(FontWeight.Bolder) 44 } 45 .width('100%') 46 .height('100%') 47 .justifyContent(FlexAlign.Center) 48 .alignItems(VerticalAlign.Center) 49 } 50 }.onBreakpointChange((currentBreakpoint: string) => { 51 this.currentBreakpoint = currentBreakpoint 52 }).width('100%') 53 } 54 .autoHide(false) 55 .sideBarWidth(100) 56 .minSideBarWidth(100) 57 .maxSideBarWidth(600) 58 } 59}