Skip to content

Commit

Permalink
Update page.js
Browse files Browse the repository at this point in the history
关闭不缓存页面时将导致findIndex返回-1,从而影响到可能需要缓存的页面.
  • Loading branch information
dnyz520 authored Dec 7, 2018
1 parent 047407a commit 1a56762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/store/modules/d2admin/modules/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,11 @@ export default {
keepAliveRemove (state, name) {
const list = [ ...state.keepAlive ]
const index = list.findIndex(item => item === name)
list.splice(index, 1)
state.keepAlive = list

if (index !== -1) {
list.splice(index, 1)
state.keepAlive = list
}
},
/**
* @description 增加一个页面的缓存设置
Expand Down

0 comments on commit 1a56762

Please sign in to comment.