优化输入框推送功能

This commit is contained in:
fofolee
2023-08-07 20:24:44 +08:00
parent 7fb35e7c2f
commit 62a9bb01d1
4 changed files with 51 additions and 24 deletions

View File

@@ -62,20 +62,21 @@ export default defineComponent({
this.utools.whole.onPluginEnter((enter) => {
this.enterPlugin(enter);
});
this.utools.whole.onMainPush(
async ({ code, type, payload }) => {
let result = await this.runCommand(code, payload, 5000);
return result.map((x) => {
return {
text: x,
};
});
},
({ code, type, payload, option }) => {
window.quickcommand.writeClipboard(option.text);
window.utools.showNotification("已复制");
}
);
window.isAppVersion4() &&
this.utools.whole.onMainPush(
async ({ code, type, payload }) => {
let result = await this.runCommand(code, payload, 5000);
return result.map((x) => {
return {
text: x,
};
});
},
({ code, type, payload, option }) => {
window.quickcommand.writeClipboard(option.text);
window.utools.showNotification("已复制");
}
);
this.utools.whole.onPluginOut(() => {
this.outPlugin();
});