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) {