• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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
18 struct HomePreviewComponent {
19   private value1: string = "hello world 1"
20   private value2: string = "hello world 2"
21   private value3: string = "hello world 3"
22 
23   build() {
24     Column() {
25       Row() {
26         Text(this.value1)
27         Text(this.value2)
28         Text(this.value3)
29       }
30       Row() {
31         Button() {
32           Text(this.value1)
33             .fontSize(20)
34         }
35         .width(100)
36         .height(20)
37         Text(this.value2)
38           .fontSize(100)
39         Text(this.value3)
40       }
41       .width(20)
42     }
43     .height(500)
44   }
45 }
46 
47 @Preview
48 @Component
49 struct HomePreviewComponent_Preview {
50   build() {
51     Column() {
52       HomePreviewComponent()
53     }
54   }
55 }
56