• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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@Component
17struct NamespaceComponent1 {
18  @Link NamespaceComponent1Link1: any
19  @Link NamespaceComponent1Link2: number
20  @Link NamespaceComponent1Link3: boolean
21  @Link NamespaceComponent1Link4: string
22
23  private myVar: number = 0
24  private myVar2: number
25
26  build() {
27    Column(){
28      Text('NamespaceComponent1')
29        .fontSize(20)
30      Text('NamespaceComponent1Link1: ' + JSON.stringify(this.NamespaceComponent1Link1))
31        .fontSize(20)
32      Text('NamespaceComponent1Link2: ' + JSON.stringify(this.NamespaceComponent1Link2))
33        .fontSize(20)
34      Text('NamespaceComponent1Link3: ' + JSON.stringify(this.NamespaceComponent1Link3))
35        .fontSize(20)
36      Text('NamespaceComponent1Link4: ' + JSON.stringify(this.NamespaceComponent1Link4))
37        .fontSize(20)
38      Text('myVar: ' + JSON.stringify(this.myVar))
39        .fontSize(20)
40      Text('myVar2: ' + JSON.stringify(this.myVar2))
41        .fontSize(20)
42    }
43  }
44}
45
46@Component
47struct NamespaceComponent2 {
48  @Link NamespaceComponent2Link1: any
49  @Link NamespaceComponent2Link2: number
50  @Link NamespaceComponent2Link3: boolean
51  @Link NamespaceComponent2Link4: string
52
53  private myVar: number = 0
54  private myVar2: number
55
56  build() {
57    Column(){
58      Text('NamespaceComponent2')
59        .fontSize(20)
60      Text('NamespaceComponent2Link1: ' + JSON.stringify(this.NamespaceComponent2Link1))
61        .fontSize(20)
62      Text('NamespaceComponent2Link2: ' + JSON.stringify(this.NamespaceComponent2Link2))
63        .fontSize(20)
64      Text('NamespaceComponent2Link3: ' + JSON.stringify(this.NamespaceComponent2Link3))
65        .fontSize(20)
66      Text('NamespaceComponent2Link4: ' + JSON.stringify(this.NamespaceComponent2Link4))
67        .fontSize(20)
68      Text('myVar: ' + JSON.stringify(this.myVar))
69        .fontSize(20)
70      Text('myVar2: ' + JSON.stringify(this.myVar2))
71        .fontSize(20)
72    }
73  }
74}
75
76@Component
77struct NamespaceComponent3 {
78  @Link NamespaceComponent3Link1: any
79  @Link NamespaceComponent3Link2: number
80  @Link NamespaceComponent3Link3: boolean
81  @Link NamespaceComponent3Link4: string
82
83  private myVar: number = 0
84  private myVar2: number
85
86  build() {
87    Column(){
88      Text('NamespaceComponent3')
89        .fontSize(20)
90      Text('NamespaceComponent3Link1: ' + JSON.stringify(this.NamespaceComponent3Link1))
91        .fontSize(20)
92      Text('NamespaceComponent3Link2: ' + JSON.stringify(this.NamespaceComponent3Link2))
93        .fontSize(20)
94      Text('NamespaceComponent3Link3: ' + JSON.stringify(this.NamespaceComponent3Link3))
95        .fontSize(20)
96      Text('NamespaceComponent3Link4: ' + JSON.stringify(this.NamespaceComponent3Link4))
97        .fontSize(20)
98      Text('myVar: ' + JSON.stringify(this.myVar))
99        .fontSize(20)
100      Text('myVar2: ' + JSON.stringify(this.myVar2))
101        .fontSize(20)
102    }
103  }
104}
105
106export { NamespaceComponent1, NamespaceComponent2 }
107
108export default NamespaceComponent3
109