提交 b5e8941b 编写于 作者: S sqsyqqy

ArkTS告警处理

Signed-off-by: Nsqsyqqy <sunqi57@huawei.com>
上级 2bbe7e3e
此差异已折叠。
......@@ -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(); // 异步任务
......
......@@ -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(); // 调用异步运算函数
......
......@@ -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, // 动画时长
......
......@@ -39,7 +39,6 @@ struct AspectRatioExample {
建议:通过减少冗余的Stack容器嵌套,每个GridItem的组件数比上面少了3个,缩短了组件刷新与渲染耗时。
```typescript
// xxx.ets
@Entry
@Component
struct AspectRatioExample {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册