fixed #21
This commit is contained in:
梁灏 2016-10-10 09:08:20 +08:00
parent 93efaba8f8
commit 4935594e4e
3 changed files with 9 additions and 6 deletions

View file

@ -41,7 +41,7 @@
<li :title="current + 1" v-if="current + 1 < allPages" :class="[`${prefixCls}-item`]" @click="changePage(current + 1)"><a>{{ current + 1 }}</a></li>
<li :title="current + 2" v-if="current + 2 < allPages" :class="[`${prefixCls}-item`]" @click="changePage(current + 2)"><a>{{ current + 2 }}</a></li>
<li title="向后 5 页" v-if="current + 3 < allPages" :class="[`${prefixCls}-item-jump-next`]" @click="fastNext"><a><i class="ivu-icon ivu-icon-ios-arrow-right"></i></a></li>
<li :title="'最后一页:' + allPages" :class="[`${prefixCls}-item`, {[`${prefixCls}-item-active`]: current == allPages}]" @click="changePage(allPages)"><a>{{ allPages }}</a></li>
<li :title="'最后一页:' + allPages" v-if="allPages > 1" :class="[`${prefixCls}-item`, {[`${prefixCls}-item-active`]: current == allPages}]" @click="changePage(allPages)"><a>{{ allPages }}</a></li>
<li
title="下一页"
:class="nextClasses"
@ -117,7 +117,8 @@
},
computed: {
allPages () {
return Math.ceil(this.total / this.pageSize);
const allPage = Math.ceil(this.total / this.pageSize);
return (allPage === 0) ? 1 : allPage;
},
simpleWrapClasses () {
return [

View file

@ -7,13 +7,15 @@
<Button @click="warning">warning</Button>
<Button @click="error">error</Button>
<Button @click="confirm">confirm</Button>
<Page :total="11" :page-size="11"></Page>
<Page :total="11" size="small"></Page>
<Page :current="1" :total="0" simple></Page>
</template>
<script>
import { Modal, Button, Message } from 'iview';
import { Modal, Button, Message, Page } from 'iview';
export default {
components: { Modal, Button },
components: { Modal, Button, Page },
props: {
},

View file

@ -1,6 +1,6 @@
{
"name": "iview",
"version": "0.9.2",
"version": "0.9.3",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",