$(function () { // 监听输入栏 utools.setSubInput(({ text }) => { console.log(text) $('#app').text(text) }, '搜索') let originText = ` But residents say this has meant less chaotic public spaces and a generally more pleasant experience walking through their neighbourhood. On a recent Friday morning, at least one in every three shops on San Hong Street was shuttered, with property listings plastered across the metal grilles. Also known as “Parallel Goods Street”, it was where traders from mainland China would take advantage of multiple entry visas into Hong Kong, filling their luggages with all manner of goods ranging from medicine, cosmetics and even baby formula unavailable in the mainland. ` utools.onPluginEnter(({ code, type, payload }) => { console.log('用户进入插件应用', code, type, payload) // 如果输入应用名直接进入应用 if (payload === "fy" || payload === "翻译") { return } // 翻译请求 // 唤出utools时传入的需要翻译的文本 if (payload) { $('#app').text(payload) utools.setSubInputValue(payload) } }) })