修改显示字段,增加信息弹窗,保存账号,增加websocket定时刷新,增加校验功能
This commit is contained in:
@@ -3,12 +3,20 @@
|
||||
<text :disabled="page <= 1" @tap.stop="gotoPage(page - 1)"><</text>
|
||||
<text v-for="item in pages" :key="getItemKey(item)" :class="{ active: item === page, ellipsis: item === '...' }" @tap.stop="gotoPage(item)">{{ item }}</text>
|
||||
<text :disabled="page >= totalPages" @tap.stop="gotoPage(page + 1)">></text>
|
||||
<text class="page_txt mgl10">跳转到</text>
|
||||
<input type="number" class="page_input" v-model="val" @blur.stop="inputPage">
|
||||
<text class="page_txt">页</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Pagination',
|
||||
data () {
|
||||
return {
|
||||
val: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
total: { // 总条目数
|
||||
type: Number,
|
||||
@@ -55,7 +63,13 @@ export default {
|
||||
if (page > 0 && page <= this.totalPages) {
|
||||
this.$emit('page-change', page)
|
||||
}
|
||||
}
|
||||
},
|
||||
inputPage() { // 跳转到指定页码
|
||||
const numericValue = Number(this.val)
|
||||
if (numericValue > 0 && numericValue <= this.totalPages) {
|
||||
this.$emit('page-change', numericValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -66,8 +80,9 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
text {
|
||||
text,.page_input {
|
||||
display: inline-block;
|
||||
padding: 0 10px;
|
||||
background-color: #fff;
|
||||
@@ -85,4 +100,18 @@ text.active {
|
||||
text.ellipsis {
|
||||
cursor: default;
|
||||
}
|
||||
.page_input {
|
||||
width: 50px
|
||||
height: 28px;
|
||||
text-align: center;
|
||||
}
|
||||
.page_txt {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
}
|
||||
.mgl10 {
|
||||
margin-left: 20px
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user