Commit 6d2b7bcbc935f8b9a5d216a8c983fcd4a73aebc6
1 parent
8869b70d
fixed #1575
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
examples/routers/page.vue
src/components/page/page.vue
... | ... | @@ -260,7 +260,7 @@ |
260 | 260 | }, |
261 | 261 | keyDown (e) { |
262 | 262 | const key = e.keyCode; |
263 | - const condition = (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key == 8 || key == 37 || key == 39; | |
263 | + const condition = (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key === 8 || key === 37 || key === 39; | |
264 | 264 | |
265 | 265 | if (!condition) { |
266 | 266 | e.preventDefault(); |
... | ... | @@ -274,12 +274,12 @@ |
274 | 274 | this.prev(); |
275 | 275 | } else if (key === 40) { |
276 | 276 | this.next(); |
277 | - } else if (key == 13) { | |
277 | + } else if (key === 13) { | |
278 | 278 | let page = 1; |
279 | 279 | |
280 | 280 | if (val > this.allPages) { |
281 | 281 | page = this.allPages; |
282 | - } else if (val <= 0) { | |
282 | + } else if (val <= 0 || !val) { | |
283 | 283 | page = 1; |
284 | 284 | } else { |
285 | 285 | page = val; | ... | ... |