Skip to content

Commit

Permalink
fixed iview#1575
Browse files Browse the repository at this point in the history
  • Loading branch information
icarusion committed Nov 7, 2017
1 parent 8869b70 commit 6d2b7bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/routers/page.vue
Expand Up @@ -4,6 +4,7 @@
{{ current }}
<Button type="primary" @click="subject">- 1</Button>
<Button type="primary" @click="change">Change</Button>
<Page :current="2" :total="50" simple></Page>
</div>
</template>
<script>
Expand Down
6 changes: 3 additions & 3 deletions src/components/page/page.vue
Expand Up @@ -260,7 +260,7 @@
},
keyDown (e) {
const key = e.keyCode;
const condition = (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key == 8 || key == 37 || key == 39;
const condition = (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || key === 8 || key === 37 || key === 39;
if (!condition) {
e.preventDefault();
Expand All @@ -274,12 +274,12 @@
this.prev();
} else if (key === 40) {
this.next();
} else if (key == 13) {
} else if (key === 13) {
let page = 1;
if (val > this.allPages) {
page = this.allPages;
} else if (val <= 0) {
} else if (val <= 0 || !val) {
page = 1;
} else {
page = val;
Expand Down

0 comments on commit 6d2b7bc

Please sign in to comment.