Commit 9ffa3f58 authored by dsq's avatar dsq

修改原生页面

parent b9c31bfa
import testNapi from 'libentry.so';
@Entry
@Component
struct FaultPage {
@State message: string = '越界测试页面';
build() {
Column() {
// 标题
Text('越界崩溃测试')
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ top: 50, bottom: 30 })
// 说明文字
Text('点击下方按钮将触发数组越界异常')
.fontSize(16)
.fontColor('#666666')
.margin({ bottom: 50 })
// 触发越界按钮
Button('触发越界崩溃')
.width('80%')
.height(50)
.backgroundColor('#FF4444')
.onClick(() => {
testNapi.FaultOut();
})
}
.width('100%')
.height('100%')
}
}
import { hilog } from '@kit.PerformanceAnalysisKit'; import { hilog } from '@kit.PerformanceAnalysisKit';
import testNapi from 'libentry.so'; import testNapi from 'libentry.so';
import router from '@ohos.router';
const DOMAIN = 0x0000; const DOMAIN = 0x0000;
...@@ -49,12 +50,12 @@ struct Index { ...@@ -49,12 +50,12 @@ struct Index {
}) })
// 越界崩溃测试按钮 // 越界崩溃测试按钮
Button('越界崩溃测试') Button('进入越界页面')
.width('80%') .width('80%')
.height(50) .height(50)
.backgroundColor('#FF0000') .backgroundColor('#FF4444')
.onClick(() => { .onClick(() => {
testNapi.FaultOut(); router.pushUrl({ url: 'pages/FaultPage' });
}) })
} }
.width('100%') .width('100%')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment