Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainKmpDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dsq
TestToolChainKmpDemo
Commits
9ffa3f58
Commit
9ffa3f58
authored
Mar 04, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改原生页面
parent
b9c31bfa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
+38
-3
FaultPage.ets
harmonyApp/entry/src/main/ets/pages/FaultPage.ets
+34
-0
Index.ets
harmonyApp/entry/src/main/ets/pages/Index.ets
+4
-3
No files found.
harmonyApp/entry/src/main/ets/pages/FaultPage.ets
0 → 100644
View file @
9ffa3f58
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%')
}
}
harmonyApp/entry/src/main/ets/pages/Index.ets
View file @
9ffa3f58
import { hilog } from '@kit.PerformanceAnalysisKit';
import testNapi from 'libentry.so';
import router from '@ohos.router';
const DOMAIN = 0x0000;
...
...
@@ -49,12 +50,12 @@ struct Index {
})
// 越界崩溃测试按钮
Button('
越界崩溃测试
')
Button('
进入越界页面
')
.width('80%')
.height(50)
.backgroundColor('#FF
0000
')
.backgroundColor('#FF
4444
')
.onClick(() => {
testNapi.FaultOut(
);
router.pushUrl({ url: 'pages/FaultPage' }
);
})
}
.width('100%')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment