From 17867245980029dca11c027576ec60ad7c2648f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 8 Jan 2021 10:09:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96search=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/02-core.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bcff5a4..c3b3db2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anot", - "version": "2.2.3", + "version": "2.2.4", "description": "Anot - 迷你mvvm框架", "main": "dist/anot.js", "files": ["dist"], diff --git a/src/02-core.js b/src/02-core.js index 4699b43..fd567a4 100644 --- a/src/02-core.js +++ b/src/02-core.js @@ -469,7 +469,7 @@ Anot.mix({ key += '' let uri = location.search - if (!key || !uri) { + if (!uri) { return null } uri = decode(uri) @@ -493,7 +493,11 @@ Anot.mix({ obj[tmp[0]] = tmp[1] } } - return obj.hasOwnProperty(key) ? obj[key] : null + if (key) { + return obj.hasOwnProperty(key) ? obj[key] : null + } else { + return obj + } }, //复制文本到粘贴板 copy: function(txt) {