打包 - 比特日记
打包
公共包
复制成功
1
2
3
4
5
6
7
8
9
10
11
1{
2 "modelVersion": "5.0.2",
3 "description": "Please describe the basic information.",
4 "dependencies": {
5 },
6 "devDependencies": {
7 "@ohos/hypium": "1.0.21",
8 "@ohos/hamock": "1.0.0",
9 "common": "file:./common"
10 }
11}
{
"modelVersion": "5.0.2",
"description": "Please describe the basic information.",
"dependencies": {
},
"devDependencies": {
"@ohos/hypium": "1.0.21",
"@ohos/hamock": "1.0.0",
"common": "file:./common"
}
}

hsp
只能在模拟器运行
复制成功
1
1Imports of unmocked HSP modules are not allowed in pages or components.
Imports of unmocked HSP modules are not allowed in pages or components.

空白页
复制成功
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
1import { add, EmptyView } from 'common'
2
3@Entry
4@Component
5struct Index {
6 @State message: string = 'Hello World';
7
8 aboutToAppear(): void {
9 console.log(`${add(1, 2)}`)
10 }
11
12 build() {
13 Column() {
14 Text(this.message)
15 EmptyView()
16 }
17 .height('100%')
18 .width('100%')
19 }
20}
import { add, EmptyView } from 'common'
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
aboutToAppear(): void {
console.log(`${add(1, 2)}`)
}
build() {
Column() {
Text(this.message)
EmptyView()
}
.height('100%')
.width('100%')
}
}

har
复制成功
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
1import { add, EmptyView } from 'common'
2import { HomePage } from 'homelibrary'
3import { OrderPage } from 'orderlibrary'
4
5@Entry
6@Component
7struct Index {
8 @State message: string = 'Hello World';
9
10 aboutToAppear(): void {
11 console.log(`${add(1, 2)}`)
12 }
13
14 build() {
15 Column() {
16 Text(this.message)
17 HomePage()
18 OrderPage()
19 EmptyView()
20 }
21 .height('100%')
22 .width('100%')
23 }
24}
import { add, EmptyView } from 'common'
import { HomePage } from 'homelibrary'
import { OrderPage } from 'orderlibrary'
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
aboutToAppear(): void {
console.log(`${add(1, 2)}`)
}
build() {
Column() {
Text(this.message)
HomePage()
OrderPage()
EmptyView()
}
.height('100%')
.width('100%')
}
}
复制成功
1
2
3
4
5
6
7
8
9
10
11
12
13
1{
2 "modelVersion": "5.0.2",
3 "description": "Please describe the basic information.",
4 "dependencies": {
5 },
6 "devDependencies": {
7 "@ohos/hypium": "1.0.21",
8 "@ohos/hamock": "1.0.0",
9 "common": "file:./common",
10 "homelibrary": "file:./features/homelibrary",
11 "orderlibrary": "file:./features/orderlibrary"
12 }
13}
{
"modelVersion": "5.0.2",
"description": "Please describe the basic information.",
"dependencies": {
},
"devDependencies": {
"@ohos/hypium": "1.0.21",
"@ohos/hamock": "1.0.0",
"common": "file:./common",
"homelibrary": "file:./features/homelibrary",
"orderlibrary": "file:./features/orderlibrary"
}
}

Copyright ©2010-2022 比特日记 All Rights Reserved.
Powered By 可尔物语
浙ICP备11005866号-12