mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-12-05 20:29:10 +00:00
仓库中添加内置的demo
This commit is contained in:
20
demo/assets/script/Helper/NativeCallJS.ts
Normal file
20
demo/assets/script/Helper/NativeCallJS.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @Author: Gongxh
|
||||
* @Date: 2025-03-22
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
function KunpoNativeCallJsHandler(jsonString: string) {
|
||||
console.log("KunpoNativeCallJsHandler", jsonString);
|
||||
// let json = JSON.parse(jsonString);
|
||||
// let functionName = json.function;
|
||||
// let args = json.args;
|
||||
// let func = _global[functionName];
|
||||
// if (func) {
|
||||
// func(...args);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
let _global = globalThis || window || global;
|
||||
(_global as any)["KunpoNativeCallJsHandler"] = KunpoNativeCallJsHandler;
|
||||
Reference in New Issue
Block a user