From b887f61b9bbcfe989429e678cfa8ab34d4fadfce Mon Sep 17 00:00:00 2001 From: fofolee Date: Sun, 27 Dec 2020 10:44:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BE=E6=A0=87=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/index.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/assets/index.js b/src/assets/index.js index 13cbcfd..c640565 100644 --- a/src/assets/index.js +++ b/src/assets/index.js @@ -1356,7 +1356,7 @@ // 从 icons8 选择图标 let getIcons8Icon = () => { let showIcon = icon => { - return $(` ${icon.name}`) + return $(` ${icon.name}`) } let showItems = item => { if (item.loading) return item.text @@ -1364,10 +1364,10 @@ } let showSelection = selection => { if (!selection.commonName) return selection.text - $('#networkImg').val(`https://img.icons8.com/color/1x/${selection.commonName}.png`) + $('#networkImgUrl').val(`https://img.icons8.com/color/1x/${selection.commonName}.png`) return showIcon(selection) } - $('#icons8').select2({ + $('#networkImg').select2({ dataType: 'json', width: '80%', delay: 250, @@ -1379,10 +1379,11 @@ offset: (params.page - 1) * 10 || 0, platform: 'color', amount: 10, - token: 'JpOyWT5TW8yYThBIk1fCbsNDd3ISSChSD5vPgCON' + token: 'JpOyWT5TW8yYThBIk1fCbsNDd3ISSChSD5vPgCON', + language: /[\u4e00-\u9fa5]/.test(params.term) ? 'zh' : 'en' } }, - processResults: function (data, params) { + processResults: function (data) { return { results: data.icons, pagination: { @@ -1415,8 +1416,8 @@ let showChangeIconWindow = () => { var html = ` - - + + ` Swal.fire({ title: "设置图标", @@ -1436,7 +1437,7 @@ html: html, showCancelButton: true, preConfirm: async () => { - let imgUrl = $('#networkImg').val() + let imgUrl = $('#networkImgUrl').val() if (imgUrl) await getRemoteImg(imgUrl) else quickcommand.showMessageBox('没有输入图标地址', 'warning') }