diff --git a/ComponentReuse/.hvigor/dependencyMap/entry/oh-package.json5 b/ComponentReuse/.hvigor/dependencyMap/entry/oh-package.json5 deleted file mode 100644 index 50a51753855fc6efdf037d5db6ab2cc001f17bbc..0000000000000000000000000000000000000000 --- a/ComponentReuse/.hvigor/dependencyMap/entry/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"name":"entry","version":"1.0.0","description":"Please describe the basic information.","main":"","author":"","license":"","dependencies":{}} \ No newline at end of file diff --git a/ComponentReuse/.hvigor/dependencyMap/negative/oh-package.json5 b/ComponentReuse/.hvigor/dependencyMap/negative/oh-package.json5 deleted file mode 100644 index 4894acea23526d3db96c7e21e313a3d8f3148189..0000000000000000000000000000000000000000 --- a/ComponentReuse/.hvigor/dependencyMap/negative/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"name":"negative","version":"1.0.0","description":"Please describe the basic information.","main":"","author":"","license":"","dependencies":{}} \ No newline at end of file diff --git a/ComponentReuse/.hvigor/dependencyMap/oh-package.json5 b/ComponentReuse/.hvigor/dependencyMap/oh-package.json5 deleted file mode 100644 index 7548331ca118580824abab8328632210cb4354fa..0000000000000000000000000000000000000000 --- a/ComponentReuse/.hvigor/dependencyMap/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"modelVersion":"5.0.0","description":"Please describe the basic information.","dependencies":{},"devDependencies":{}} \ No newline at end of file diff --git a/ComponentReuse/.hvigor/dependencyMap/positive/oh-package.json5 b/ComponentReuse/.hvigor/dependencyMap/positive/oh-package.json5 deleted file mode 100644 index a367f1b94274b908c7153447c79bf47775c26401..0000000000000000000000000000000000000000 --- a/ComponentReuse/.hvigor/dependencyMap/positive/oh-package.json5 +++ /dev/null @@ -1 +0,0 @@ -{"name":"positive","version":"1.0.0","description":"Please describe the basic information.","main":"","author":"","license":"","dependencies":{}} \ No newline at end of file diff --git a/ComponentReuse/.idea/vcs.xml b/ComponentReuse/.idea/vcs.xml deleted file mode 100644 index 6c0b8635858dc7ad44b93df54b762707ce49eefc..0000000000000000000000000000000000000000 --- a/ComponentReuse/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ComponentReuse/.idea/workspace.xml b/ComponentReuse/.idea/workspace.xml deleted file mode 100644 index aa7035bfde535a189ae87072a34953d6ce847616..0000000000000000000000000000000000000000 --- a/ComponentReuse/.idea/workspace.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ComponentReuse/build-profile.json5 b/ComponentReuse/build-profile.json5 index c0e574ec98ff2dd826bb917ed7f75f557a4b3d77..2b8af09623cb36fb810098e4a4569d99d2132f98 100644 --- a/ComponentReuse/build-profile.json5 +++ b/ComponentReuse/build-profile.json5 @@ -23,21 +23,7 @@ "name": "release" } ], - "signingConfigs": [ - { - "name": "default", - "type": "HarmonyOS", - "material": { - "certpath": "C:\\Users\\Administrator\\.ohos\\config\\default_ComponentReuse_1G0vMCMHOsZmf7wIwtNJra9ntCh1AHvfjBeF8R1SDZ0=.cer", - "keyAlias": "debugKey", - "keyPassword": "0000001A00B5BCCED3D2F676ED0467E7F152B3D3D2CEEC586A45A35DD850540FBEE7456D76DDE5348EFB", - "profile": "C:\\Users\\Administrator\\.ohos\\config\\default_ComponentReuse_1G0vMCMHOsZmf7wIwtNJra9ntCh1AHvfjBeF8R1SDZ0=.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "C:\\Users\\Administrator\\.ohos\\config\\default_ComponentReuse_1G0vMCMHOsZmf7wIwtNJra9ntCh1AHvfjBeF8R1SDZ0=.p12", - "storePassword": "0000001A303AB263810A26D998EEB0B2FC6D123BFCD3848BF45DA76237A8A6A16B0AD951188842ED1A13" - } - } - ] + "signingConfigs": [] }, "modules": [ { diff --git a/ComponentReuse/negative/src/main/ets/common/MockDataV2.ets b/ComponentReuse/negative/src/main/ets/common/MockDataV2.ets deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets index f91dcd338758e2bdd62af8925b4c462da2502ae5..135c64880b2e58ef49f1960100cdc204433373b3 100644 --- a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets +++ b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildImproperReuseOfComponentsScene1() { ImproperReuseOfComponentsScene1() @@ -62,10 +56,6 @@ struct ImproperReuseOfComponentsScene1 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -99,10 +89,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -121,10 +107,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -140,10 +122,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets index 803ac9feaee7fd45ea6d7bb085168eae960dbbae..68a4636fb3f4e74dfa17fda4f0ddccc11f5681c3 100644 --- a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets +++ b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildImproperReuseOfComponentsScene2() { ImproperReuseOfComponentsScene2() @@ -63,10 +57,6 @@ struct ImproperReuseOfComponentsScene2 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -100,10 +90,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -122,10 +108,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -141,10 +123,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets index f3290875ea3e6595ad89fa6d05e2c8fec6322350..cf5480258732bc1e5006946102767ce2ee7b91ce 100644 --- a/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets +++ b/ComponentReuse/negative/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildImproperReuseOfComponentsScene3() { ImproperReuseOfComponentsScene3() @@ -63,10 +57,6 @@ struct ImproperReuseOfComponentsScene3 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -106,10 +96,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -127,10 +113,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -145,10 +127,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -162,10 +140,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -191,10 +165,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene1.ets b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene1.ets index 0f2ee9b7c08a8c0dc25784e8d1e79c95a2d81589..815d6283d02d69fdb84dc038122ee41543af7488 100644 --- a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene1.ets +++ b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene1.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildNoReuseScene1() { NoReuseScene1() @@ -62,10 +56,6 @@ struct NoReuseScene1 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -98,10 +88,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -119,10 +105,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -137,10 +119,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureOne.ets b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureOne.ets index 7368cda95bcbf0438cc6cfcf59fc0f9515c82e70..57b482db2aa0d784e0873ea6420262f1c6d953e0 100644 --- a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureOne.ets +++ b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureOne.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildNoReuseScene2_StructureOne() { NoReuseScene2_StructureOne() @@ -62,10 +56,6 @@ struct NoReuseScene2_StructureOne { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -105,10 +95,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -126,10 +112,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -144,10 +126,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -161,10 +139,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -190,10 +164,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureTwo.ets b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureTwo.ets index 2016d15db447d04a715114c38f6082acc92dae8a..8eaad66ba7c3098156cd48728df2e216bce95da8 100644 --- a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureTwo.ets +++ b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene2_StructureTwo.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildNoReuseScene2_StructureTwo() { NoReuseScene2_StructureTwo() @@ -68,10 +62,6 @@ struct NoReuseScene2_StructureTwo { struct SingleImageNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -104,10 +94,6 @@ struct SingleImageNewsContent { struct ThreeImageNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -140,10 +126,6 @@ struct ThreeImageNewsContent { struct VideoNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -176,10 +158,6 @@ struct VideoNewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -197,10 +175,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -215,10 +189,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -232,10 +202,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -261,10 +227,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene3.ets b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene3.ets index 7cf4c7a734ca69d805fe442bcb09ebe6bc5e912c..85697a4a48669f7c64045d709011f06c26866a53 100644 --- a/ComponentReuse/negative/src/main/ets/pages/NoReuseScene3.ets +++ b/ComponentReuse/negative/src/main/ets/pages/NoReuseScene3.ets @@ -17,12 +17,6 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder function buildNoReuseScene3() { NoReuseScene3() @@ -138,10 +132,6 @@ struct NoReuseScene3 { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -159,10 +149,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -177,10 +163,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -194,10 +176,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -223,10 +201,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1Positive.ets similarity index 86% rename from ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets rename to ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1Positive.ets index 0b742d08bb03cd662d11b2653c2c699c7e3fe447..23ba2254217f616caf97cbf79dda173745401569 100644 --- a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1.ets +++ b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene1Positive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildImproperReuseOfComponentsScene1() { - ImproperReuseOfComponentsScene1() +function buildImproperReuseOfComponentsScene1Positive() { + ImproperReuseOfComponentsScene1Positive() } // 父组件未使用复用,子组件使用复用 @Component -struct ImproperReuseOfComponentsScene1 { +struct ImproperReuseOfComponentsScene1Positive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -63,10 +57,6 @@ struct ImproperReuseOfComponentsScene1 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -99,10 +89,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -120,10 +106,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -138,10 +120,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2Positive.ets similarity index 86% rename from ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets rename to ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2Positive.ets index 762d59841d1d1e0adfee3279b5cb54acc131f647..e6e02d6b022d02c8db19562409f5b171382f8159 100644 --- a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2.ets +++ b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene2Positive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildImproperReuseOfComponentsScene2() { - ImproperReuseOfComponentsScene2() +function buildImproperReuseOfComponentsScene2Positive() { + ImproperReuseOfComponentsScene2Positive() } // 复用嵌套 @Component -struct ImproperReuseOfComponentsScene2 { +struct ImproperReuseOfComponentsScene2Positive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -63,10 +57,6 @@ struct ImproperReuseOfComponentsScene2 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -99,10 +89,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -120,10 +106,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -138,10 +120,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3Positive.ets similarity index 88% rename from ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets rename to ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3Positive.ets index 396a0935610dd2da4092f29c44f7d46f96677ae2..edbe5aba6cbf7d6bed341fb21ebe2ae54351e1ab 100644 --- a/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3.ets +++ b/ComponentReuse/positive/src/main/ets/pages/ImproperReuseOfComponentsScene3Positive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildImproperReuseOfComponentsScene3() { - ImproperReuseOfComponentsScene3() +function buildImproperReuseOfComponentsScene3Positive() { + ImproperReuseOfComponentsScene3Positive() } // reuseId分类过粗 @Component -struct ImproperReuseOfComponentsScene3 { +struct ImproperReuseOfComponentsScene3Positive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -63,10 +57,6 @@ struct ImproperReuseOfComponentsScene3 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -106,10 +96,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -127,10 +113,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -145,10 +127,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -162,10 +140,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -191,10 +165,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene1.ets b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene1Positive.ets similarity index 88% rename from ComponentReuse/positive/src/main/ets/pages/NoReuseScene1.ets rename to ComponentReuse/positive/src/main/ets/pages/NoReuseScene1Positive.ets index c039a5bc011749b46d20408cf199172d40e4b4e0..093206de353b19686644af81451daf8b3e826c89 100644 --- a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene1.ets +++ b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene1Positive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildNoReuseScene1() { - NoReuseScene1() +function buildNoReuseScene1Positive() { + NoReuseScene1Positive() } // 未使用组件复用:场景1 @Component -struct NoReuseScene1 { +struct NoReuseScene1Positive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -63,10 +57,6 @@ struct NoReuseScene1 { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -99,10 +89,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -120,10 +106,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -138,10 +120,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) diff --git a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOne.ets b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOnePositive.ets similarity index 89% rename from ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOne.ets rename to ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOnePositive.ets index 7fb0572ade8d6ff6049d22e1d917f427eead6fbb..bfefc19df708df5b784a5faf11f36ae8f90e070d 100644 --- a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOne.ets +++ b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureOnePositive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildNoReuseScene2_StructureOne() { - NoReuseScene2_StructureOne() +function buildNoReuseScene2_StructureOnePositive() { + NoReuseScene2_StructureOnePositive() } // 未使用组件复用:场景2 结构一 @Component -struct NoReuseScene2_StructureOne { +struct NoReuseScene2_StructureOnePositive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -62,10 +56,6 @@ struct NoReuseScene2_StructureOne { struct NewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -105,10 +95,6 @@ struct NewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -126,10 +112,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -144,10 +126,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -161,10 +139,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -190,10 +164,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwo.ets b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwoPositive.ets similarity index 89% rename from ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwo.ets rename to ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwoPositive.ets index cff79444a85d1d34d4767b5bccdc686c2900da17..6457b5a7b2e3b569cd42643aaaee6b6c514ab523 100644 --- a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwo.ets +++ b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene2_StructureTwoPositive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildNoReuseScene2_StructureTwo() { - NoReuseScene2_StructureTwo() +function buildNoReuseScene2_StructureTwoPositive() { + NoReuseScene2_StructureTwoPositive() } // 未使用组件复用:场景2 结构二 @Component -struct NoReuseScene2_StructureTwo { +struct NoReuseScene2_StructureTwoPositive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -69,10 +63,6 @@ struct NoReuseScene2_StructureTwo { struct SingleImageNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -106,10 +96,6 @@ struct SingleImageNewsContent { struct ThreeImageNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -143,10 +129,6 @@ struct ThreeImageNewsContent { struct VideoNewsContent { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - @Builder myBuilder(item: ItemData) { TopView({ item: item }) @@ -179,10 +161,6 @@ struct VideoNewsContent { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -200,10 +178,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -218,10 +192,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -235,10 +205,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -264,10 +230,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene3.ets b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene3Positive.ets similarity index 92% rename from ComponentReuse/positive/src/main/ets/pages/NoReuseScene3.ets rename to ComponentReuse/positive/src/main/ets/pages/NoReuseScene3Positive.ets index 749737c7d4c1e71df9d97e7874633b03b4e3444e..a6247d555077583335632d142a239ba07e2b7da4 100644 --- a/ComponentReuse/positive/src/main/ets/pages/NoReuseScene3.ets +++ b/ComponentReuse/positive/src/main/ets/pages/NoReuseScene3Positive.ets @@ -17,20 +17,14 @@ import { ItemDataSource } from '../model/ItemDataSource'; import { ItemData } from '../model/ItemData'; import { genMockItemData } from '../common/MockData'; -function count() { - for (let index = 0; index < 10000; index++) { - console.debug('fun index:' + index); - } -} - @Builder -function buildNoReuseScene3() { - NoReuseScene3() +function buildNoReuseScene3Positive() { + NoReuseScene3Positive() } // 未使用组件复用:场景3 @Component -struct NoReuseScene3 { +struct NoReuseScene3Positive { private dataSource: ItemDataSource = new ItemDataSource(); aboutToAppear(): void { @@ -138,10 +132,6 @@ struct NoReuseScene3 { struct TopView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.title) .fontSize(16) @@ -160,10 +150,6 @@ struct TopView { struct BottomView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Text(this.item.tail) .fontSize(12) @@ -179,10 +165,6 @@ struct BottomView { struct MiddleSingleImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Image(this.item.preview) .width(158) @@ -197,10 +179,6 @@ struct MiddleSingleImageView { struct MiddleThreeImageView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Row() { Image(this.item.pics[0]) @@ -227,10 +205,6 @@ struct MiddleThreeImageView { struct MiddleVideoView { @ObjectLink item: ItemData; - aboutToAppear(): void { - count(); - } - build() { Stack() { Image(this.item.preview) diff --git a/ComponentReuse/positive/src/main/resources/base/profile/route_map.json b/ComponentReuse/positive/src/main/resources/base/profile/route_map.json index 96d1b687ea92dc43fb6985b9c69dc89711a5b930..e3c2818e9a0eecf4e28cc32948e648e45f30463b 100644 --- a/ComponentReuse/positive/src/main/resources/base/profile/route_map.json +++ b/ComponentReuse/positive/src/main/resources/base/profile/route_map.json @@ -1,39 +1,39 @@ { "routerMap": [ { - "name": "NoReuseScene1", - "pageSourceFile": "src/main/ets/pages/NoReuseScene1.ets", - "buildFunction": "buildNoReuseScene1" + "name": "NoReuseScene1Positive", + "pageSourceFile": "src/main/ets/pages/NoReuseScene1Positive.ets", + "buildFunction": "buildNoReuseScene1Positive" }, { - "name": "NoReuseScene2_StructureOne", - "pageSourceFile": "src/main/ets/pages/NoReuseScene2_StructureOne.ets", - "buildFunction": "buildNoReuseScene2_StructureOne" + "name": "NoReuseScene2_StructureOnePositive", + "pageSourceFile": "src/main/ets/pages/NoReuseScene2_StructureOnePositive.ets", + "buildFunction": "buildNoReuseScene2_StructureOnePositive" }, { - "name": "NoReuseScene2_StructureTwo", - "pageSourceFile": "src/main/ets/pages/NoReuseScene2_StructureTwo.ets", - "buildFunction": "buildNoReuseScene2_StructureTwo" + "name": "buildNoReuseScene2_StructureTwoPositive", + "pageSourceFile": "src/main/ets/pages/NoReuseScene2_StructureTwoPositive.ets", + "buildFunction": "buildNoReuseScene2_StructureTwoPositive" }, { - "name": "NoReuseScene3", - "pageSourceFile": "src/main/ets/pages/NoReuseScene3.ets", - "buildFunction": "buildNoReuseScene3" + "name": "NoReuseScene3Positive", + "pageSourceFile": "src/main/ets/pages/NoReuseScene3Positive.ets", + "buildFunction": "buildNoReuseScene3Positive" }, { - "name": "ImproperReuseOfComponentsScene1", - "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene1.ets", - "buildFunction": "buildImproperReuseOfComponentsScene1" + "name": "ImproperReuseOfComponentsScene1Positive", + "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene1Positive.ets", + "buildFunction": "buildImproperReuseOfComponentsScene1Positive" }, { - "name": "ImproperReuseOfComponentsScene2", - "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene2.ets", - "buildFunction": "buildImproperReuseOfComponentsScene2" + "name": "ImproperReuseOfComponentsScene2Positive", + "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene2Positive.ets", + "buildFunction": "buildImproperReuseOfComponentsScene2Positive" }, { - "name": "ImproperReuseOfComponentsScene3", - "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene3.ets", - "buildFunction": "buildImproperReuseOfComponentsScene3" + "name": "ImproperReuseOfComponentsScene3Positive", + "pageSourceFile": "src/main/ets/pages/ImproperReuseOfComponentsScene3Positive.ets", + "buildFunction": "buildImproperReuseOfComponentsScene3Positive" } ] } \ No newline at end of file