增加分页器删除最后一条数据时,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>", "author": "Pan <panfree23@gmail.com>",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve --open",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "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: { methods: {
handleSizeChange(val) { handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val }) this.$emit('pagination', { page: this.currentPage, limit: val })

View File

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