Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainDemo
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
TestToolChainDemo
Commits
0cbeb711
Commit
0cbeb711
authored
Jul 03, 2026
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ArtkTs跳转问题
parent
08424c2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
napi_init.cpp
harmonyApp/entry/src/main/cpp/napi_init.cpp
+1
-1
Index.ets
harmonyApp/entry/src/main/ets/pages/Index.ets
+3
-1
No files found.
harmonyApp/entry/src/main/cpp/napi_init.cpp
View file @
0cbeb711
...
...
@@ -27,7 +27,7 @@ EXTERN_C_START
static
napi_value
Init
(
napi_env
env
,
napi_value
exports
)
{
androidx_compose_ui_arkui_init
(
env
,
exports
);
napi_property_descriptor
desc
[]
=
{
{
"MainArkUIViewController"
,
nullptr
,
NapiMainArkUIViewController
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"MainArkUIVi
s
ewController"
,
nullptr
,
NapiMainArkUIViewController
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"testArkTsToKotin"
,
nullptr
,
nativeTestArkTsToKotin
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
};
napi_define_properties
(
env
,
exports
,
sizeof
(
desc
)
/
sizeof
(
desc
[
0
]),
desc
);
...
...
harmonyApp/entry/src/main/ets/pages/Index.ets
View file @
0cbeb711
import { Compose } from '@cpf-kmp-cmp/compose';
import { hilog } from '@kit.PerformanceAnalysisKit';
import nativeApi from 'libentry.so';
import { MainArkUIViewController, testArkTsToKotin } from 'libentry.so';
import { testArkTsToArkTs } from './TestJumpClass';
import { MyFunction } from './MyFunction';
...
...
@@ -20,7 +21,8 @@ struct Index {
let unusedInt: number = 0;//未使用的变量
//ArkTs到Kotlin的单向跳转
testArkTsToKotin();
nativeApi.testArkTsToKotin();
//原生内部跳转
testArkTsToArkTs();
...
...
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