example: CallExternalScriptFunctions (#946)
This commit is contained in:
7
example/js/CallExternalScriptFunctions/main.js
Normal file
7
example/js/CallExternalScriptFunctions/main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// 加载 utils 模块
|
||||
eval(file.readTextSync("utils.js"));
|
||||
|
||||
(async function () {
|
||||
utils.logInfo();
|
||||
})();
|
||||
|
||||
12
example/js/CallExternalScriptFunctions/manifest.json
Normal file
12
example/js/CallExternalScriptFunctions/manifest.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"manifestVersion": 1,
|
||||
"name": "调用其他脚本函数",
|
||||
"version": "1.0.0",
|
||||
"description": "这是一个测试脚本,用于调用其他脚本中的函数。",
|
||||
"authors": [
|
||||
{
|
||||
"name": "作者名"
|
||||
}
|
||||
],
|
||||
"main": "main.js"
|
||||
}
|
||||
7
example/js/CallExternalScriptFunctions/utils.js
Normal file
7
example/js/CallExternalScriptFunctions/utils.js
Normal file
@@ -0,0 +1,7 @@
|
||||
function logInfo() {
|
||||
log.info("你好,我是一个utils模块的测试函数");
|
||||
}
|
||||
|
||||
this.utils = {
|
||||
logInfo
|
||||
};
|
||||
Reference in New Issue
Block a user