<script>
import iPage from 'iview-mpvue/dist/components/page/page'
export default {
components: {
'i-page': iPage
}
}
</script>
带有文字的按钮
<i-page :current="current" total="5" v-on:change="handleChange">
<div slot="prev">Prev</div>
<div slot="next">Next</div>
</i-page>
带有文字和图标的按钮
<i-page :current="current" total="5" v-on:change="handleChange">
<div slot="prev">
<i-icon type="return"></i-icon>
上一步
</div>
<div slot="next">
下一步
<i-icon type="enter"></i-icon>
</div>
</i-page>
隐藏数字
<i-page :current="current" total="5" :simple="true" v-on:change="handleChange">
<div slot="prev">Prev</div>
<div slot="next">Next</div>
</i-page>
只显示数字
<i-page :current="current" total="5" mode="number" v-on:change="handleChange"></i-page>
显示点
<i-page :current="current" total="5" mode="pointer" v-on:change="handleChange"></i-page>
<script>
export default {
...
data() {
return {
current: 1
}
},
methods: {
handleChange (detail) {
const type = detail.type;
if (type === 'next') {
this.current = this.current + 1
} else if (type === 'prev') {
this.current = this.current - 1
}
}
}
}
</script>