diff --git a/zh-cn/application-dev/performance/.idea/workspace.xml b/zh-cn/application-dev/performance/.idea/workspace.xml new file mode 100644 index 0000000000000000000000000000000000000000..5497277bc72c3d4415f1fcfc10a8fd19d4e798d9 --- /dev/null +++ b/zh-cn/application-dev/performance/.idea/workspace.xml @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-cold-start-speed.md b/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-cold-start-speed.md index 9a8575e537ec82d39536ed71d9ac2de44b95eb43..5c74b68967bac572396a5c85782fc35d1b4d3ed8 100644 --- a/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-cold-start-speed.md +++ b/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-cold-start-speed.md @@ -73,8 +73,8 @@ aboutToAppear函数会在创建自定义组件实例后,页面绘制之前执 @Entry @Component struct Index { - @State private text: string = undefined; - private count: number = undefined; + @State private text: string = ""; + private count: number = 0; aboutToAppear() { this.computeTaskAsync(); // 异步任务 diff --git a/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-response.md b/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-response.md index 4762a0b23c11060826420b743201265e47023772..98466b306c6590d2f628be1452e4f217fd75b88d 100644 --- a/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-response.md +++ b/zh-cn/application-dev/performance/improve-application-startup-and-response/improve-application-response.md @@ -107,7 +107,7 @@ struct AspectRatioExample { @Component struct AspectRatioExample { @State private children: string[] = ['1', '2', '3', '4', '5', '6']; - private count: number = undefined; + private count: number = 0; aboutToAppear() { this.computeTaskAsync(); // 调用异步运算函数 diff --git a/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-animation-frame-loss.md b/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-animation-frame-loss.md index 2aed2e3f3fd5c9f08fec6338c170ccc614f28c6e..8e677d2e542d663f00b7ffaacc0a5fbab8b140b5 100644 --- a/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-animation-frame-loss.md +++ b/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-animation-frame-loss.md @@ -17,8 +17,8 @@ struct AttrAnimationExample { computeSize() { let duration = 2000 let period = 16 - let widthSizeEnd = undefined - let heightSizeEnd = undefined + let widthSizeEnd = 0 + let heightSizeEnd = 0 if (this.flag) { widthSizeEnd = 100 heightSizeEnd = 50 @@ -67,7 +67,7 @@ struct AttrAnimationExample { build() { Column() { Button('click me') - .onClick((event: ClickEvent) => { + .onClick((event?: ClickEvent | undefined) => { if (this.flag) { this.widthSize = 100 this.heightSize = 50 @@ -107,7 +107,7 @@ struct AnimateToExample { build() { Column() { Button('click me') - .onClick((event: ClickEvent) => { + .onClick((event?: ClickEvent | undefined) => { if (this.flag) { animateTo({ duration: 2000, // 动画时长 diff --git a/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-view-nesting-levels.md b/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-view-nesting-levels.md index bfe962fc77ec86d7749fc238c0b848446d829ff9..d2df662443abfb850ede59ea9e66f0c80f93fabb 100644 --- a/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-view-nesting-levels.md +++ b/zh-cn/application-dev/performance/reduce-frame-loss-and-frame-freezing/reduce-view-nesting-levels.md @@ -39,7 +39,6 @@ struct AspectRatioExample { 建议:通过减少冗余的Stack容器嵌套,每个GridItem的组件数比上面少了3个,缩短了组件刷新与渲染耗时。 ```typescript -// xxx.ets @Entry @Component struct AspectRatioExample {