更改本地储存项名、更改提示组件
This commit is contained in:
@@ -112,7 +112,7 @@ export default {
|
|||||||
clearTimeout(this.debounce.saveConfig);
|
clearTimeout(this.debounce.saveConfig);
|
||||||
|
|
||||||
this.debounce.saveConfig = setTimeout(() => {
|
this.debounce.saveConfig = setTimeout(() => {
|
||||||
localStorage.setItem('config', JSON.stringify(obj));
|
localStorage.setItem('navConfig', JSON.stringify(obj));
|
||||||
}, 2000);
|
}, 2000);
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -130,7 +130,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
var configStr = localStorage.getItem('config');
|
var configStr = localStorage.getItem('navConfig');
|
||||||
var configObj = {};
|
var configObj = {};
|
||||||
|
|
||||||
if (configStr != null) {
|
if (configStr != null) {
|
||||||
|
@@ -62,14 +62,14 @@ export default {
|
|||||||
if (type == 'cache') {
|
if (type == 'cache') {
|
||||||
localStorage.removeItem('navLinksCache');
|
localStorage.removeItem('navLinksCache');
|
||||||
} else if (type == 'settings') {
|
} else if (type == 'settings') {
|
||||||
localStorage.removeItem('config');
|
localStorage.removeItem('navConfig');
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$notify({
|
this.$message({
|
||||||
type: 'success',
|
message: '已清除,2s 后自动刷新',
|
||||||
message: '已清除,2s 后自动刷新'
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -78,9 +78,9 @@ export default {
|
|||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|
||||||
this.$notify({
|
this.$message({
|
||||||
type: 'info',
|
message: '取消清除',
|
||||||
message: '取消清除'
|
type: 'info'
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user