增加分页器删除最后一条数据时,currentPage没有减一,页面列表为空的问题、解决启动弹出两个页面

This commit is contained in:
shiyanbin 2019-12-11 17:37:03 +08:00
parent 65d8c451e8
commit dceb2119eb
3 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@
"author": "Pan <panfree23@gmail.com>",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",
"dev": "vue-cli-service serve --open",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",

View File

@ -73,6 +73,14 @@ export default {
}
}
},
watch: {
total() {
// currentPage
if (this.total === (this.currentPage - 1) * this.limit && this.total !== 0) {
this.$emit('pagination', { page: this.currentPage - 1, limit: this.pageSize })
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })

View File

@ -31,7 +31,6 @@ module.exports = {
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true