From bf5f3ed91f5f1f8ed48d1542ca5037a0e6989902 Mon Sep 17 00:00:00 2001 From: Frost-ZX <30585462+Frost-ZX@users.noreply.github.com> Date: Thu, 11 Feb 2021 15:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2=E6=A1=86?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=89=93=E5=BC=80=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index ba1754a..64df571 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -3,7 +3,9 @@ - + @@ -18,7 +20,9 @@ - + {{ item.title }} @@ -202,6 +206,7 @@ export default { * 搜索引擎 */ searchEngineSubmit() { + var vm = this; var search = this.searchEngine; var keyword = search.keyword; var types = search.types; @@ -212,13 +217,12 @@ export default { } for (let index in types) { - if (types[index].name == search.type) { + if (types[index].name == vm.config.searchEngine) { url = types[index].url.replace(/%keyword%/, keyword); + vm.openLink(url); break; } } - - window.open(url, '_blank'); }, /** * 搜索链接 @@ -278,6 +282,7 @@ export default { .wrapper { width: 100%; + min-width: 16rem; max-width: 60rem; } @@ -285,7 +290,6 @@ export default { display: flex; align-items: center; flex-direction: column; - padding: 0.5rem; .search-bar { display: flex; @@ -294,7 +298,6 @@ export default { top: 0.5rem; z-index: 100; width: 100%; - min-width: 16rem; max-width: 40rem; height: 2.8rem; border-radius: 0.25rem; @@ -351,7 +354,7 @@ export default { font-size: 1rem; > label { - margin: 3% 1.5%; + margin: 1em 0.5em; margin-top: 0; padding: 1em; width: 45%;