From a0ddfb390d4505c334db89e953f732653d89619e Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 29 Jul 2020 11:46:08 +0800 Subject: [PATCH] opt some --- plugin/input.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin/input.js b/plugin/input.js index 666760c2..1d81ca4a 100644 --- a/plugin/input.js +++ b/plugin/input.js @@ -10,11 +10,10 @@ Volcanos("onaction", {help: "控件交互", list: [], }, onclick: function(event, can) { if (can.Conf("name") == "添加") { - setTimeout(async () => { - const text = await navigator.clipboard.readText(); - console.log(text); + navigator.clipboard.readText().then(function(text) { + console.log(text) can.run(event, ["action", "insert", "paste", "", text], function() {}) - }, 20) + }) return }