mirror of https://github.com/halo-dev/halo-admin
fixed #52
parent
e0d568a8fe
commit
a8c204661b
|
@ -120,6 +120,7 @@ export default {
|
||||||
if (this.attachmentDrawerVisible) {
|
if (this.attachmentDrawerVisible) {
|
||||||
this.attachmentDrawerVisible = false
|
this.attachmentDrawerVisible = false
|
||||||
}
|
}
|
||||||
|
window.onbeforeunload = null
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
if (this.postSettingVisible) {
|
if (this.postSettingVisible) {
|
||||||
|
@ -128,7 +129,25 @@ export default {
|
||||||
if (this.attachmentDrawerVisible) {
|
if (this.attachmentDrawerVisible) {
|
||||||
this.attachmentDrawerVisible = false
|
this.attachmentDrawerVisible = false
|
||||||
}
|
}
|
||||||
next()
|
if (this.postToStage.originalContent) {
|
||||||
|
const answer = window.confirm('当前文章数据未保存,确定要离开吗?')
|
||||||
|
if (answer) {
|
||||||
|
next()
|
||||||
|
} else {
|
||||||
|
next(false)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
window.onbeforeunload = function(e) {
|
||||||
|
e = e || window.event
|
||||||
|
if (e) {
|
||||||
|
e.returnValue = '当前文章数据未保存,确定要离开吗?'
|
||||||
|
}
|
||||||
|
return '当前文章数据未保存,确定要离开吗?'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options'])
|
...mapGetters(['options'])
|
||||||
|
|
|
@ -110,6 +110,7 @@ export default {
|
||||||
if (this.attachmentDrawerVisible) {
|
if (this.attachmentDrawerVisible) {
|
||||||
this.attachmentDrawerVisible = false
|
this.attachmentDrawerVisible = false
|
||||||
}
|
}
|
||||||
|
window.onbeforeunload = null
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
if (this.sheetSettingVisible) {
|
if (this.sheetSettingVisible) {
|
||||||
|
@ -118,7 +119,25 @@ export default {
|
||||||
if (this.attachmentDrawerVisible) {
|
if (this.attachmentDrawerVisible) {
|
||||||
this.attachmentDrawerVisible = false
|
this.attachmentDrawerVisible = false
|
||||||
}
|
}
|
||||||
next()
|
if (this.sheetToStage.originalContent) {
|
||||||
|
const answer = window.confirm('当前页面数据未保存,确定要离开吗?')
|
||||||
|
if (answer) {
|
||||||
|
next()
|
||||||
|
} else {
|
||||||
|
next(false)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
window.onbeforeunload = function(e) {
|
||||||
|
e = e || window.event
|
||||||
|
if (e) {
|
||||||
|
e.returnValue = '当前页面数据未保存,确定要离开吗?'
|
||||||
|
}
|
||||||
|
return '当前页面数据未保存,确定要离开吗?'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options'])
|
...mapGetters(['options'])
|
||||||
|
|
Loading…
Reference in New Issue