添加函数返回、完善注入JS功能

This commit is contained in:
fofolee
2025-01-22 00:52:53 +08:00
parent 0094cb6c29
commit d69c473fe7
5 changed files with 116 additions and 4 deletions

View File

@@ -50,3 +50,8 @@ export const SystemCommandEditor = defineAsyncComponent(() =>
export const SelectListEditor = defineAsyncComponent(() =>
import("components/composer/ui/SelectListEditor.vue")
);
// 编程组件
export const ReturnEditor = defineAsyncComponent(() =>
import("components/composer/script/ReturnEditor.vue")
);

View File

@@ -17,9 +17,11 @@ export const scriptCommands = {
],
},
{
value: "(function(code){new Function(code)()})",
value: "injectJs",
label: "注入JS脚本",
icon: "script",
neverHasOutput: true,
isExpression: true,
config: [
{
label: "JS脚本",
@@ -29,11 +31,10 @@ export const scriptCommands = {
],
},
{
value: "quickcommand.runAppleScript",
label: "执行 AppleScript",
value: "quickcommand.runCode",
label: "执行代码",
icon: "script",
outputVariable: "result",
saveOutput: true,
config: [
{
label: "脚本",
@@ -42,5 +43,11 @@ export const scriptCommands = {
},
],
},
{
value: "return",
label: "函数返回",
neverHasOutput: true,
component: "ReturnEditor",
},
],
};