✨ 完善刷新/关闭编辑界面提示 https://github.com/rymcu/forest/issues/34
This commit is contained in:
parent
7763a1cc0d
commit
267f05fd25
@ -238,6 +238,20 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.$confirm('系统可能不会保存您所做的更改。', '离开此网站?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
next();
|
||||
}).catch(() => {
|
||||
return false
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.onbeforeunload = null;
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('beforeunload', e => {
|
||||
e = e || window.event;
|
||||
|
@ -254,6 +254,20 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.$confirm('系统可能不会保存您所做的更改。', '离开此网站?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
next();
|
||||
}).catch(() => {
|
||||
return false
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.onbeforeunload = null;
|
||||
},
|
||||
async mounted() {
|
||||
window.addEventListener('beforeunload', e => {
|
||||
e = e || window.event;
|
||||
|
@ -48,6 +48,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import {mapState} from 'vuex';
|
||||
import { isBrowser } from '~/environment'
|
||||
|
||||
export default {
|
||||
name: "PostArticle",
|
||||
@ -321,6 +322,20 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.$confirm('系统可能不会保存您所做的更改。', '离开此网站?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
next();
|
||||
}).catch(() => {
|
||||
return false
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.onbeforeunload = null;
|
||||
},
|
||||
async mounted() {
|
||||
window.addEventListener('beforeunload', e => {
|
||||
e = e || window.event;
|
||||
|
@ -338,6 +338,20 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
this.$confirm('系统可能不会保存您所做的更改。', '离开此网站?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
next();
|
||||
}).catch(() => {
|
||||
return false
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.onbeforeunload = null;
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('beforeunload', e => {
|
||||
e = e || window.event;
|
||||
|
Loading…
Reference in New Issue
Block a user