修改综合演练三维驾驶返回未destory

This commit is contained in:
sunzhenyu 2020-12-11 18:02:56 +08:00
parent 72abaf9643
commit caeea6d9d6

View File

@ -167,6 +167,9 @@ export default {
// this.$destroy(); // this.$destroy();
} }
}, },
destroyed(){
window.removeEventListener('popstate', this.goBack, false);
},
computed: { computed: {
userId() { userId() {
return this.$store.state.user ? this.$store.state.user.id : ''; return this.$store.state.user ? this.$store.state.user.id : '';
@ -180,9 +183,27 @@ export default {
if(this.$route.query.type == "DRIVE"){ if(this.$route.query.type == "DRIVE"){
this.backmsg = "退出"; this.backmsg = "退出";
} }
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.goBack, false);
}
// this.$refs.mmiui.init(); // this.$refs.mmiui.init();
}, },
methods: { methods: {
goBack(){
if(this.$route.query.type == "DRIVE"){
store.dispatch('LogOut').then(() => {
location.reload();
});
}else{
this.$emit('showdriving');
this.jlmap3d.eventoff();
this.jlmap3d.animateoff();
// this.jlmap3d = null;
}
// this.jlmap3d = null;
},
show: function (skinCode,group,zindex) { show: function (skinCode,group,zindex) {
// console.log("show"); // console.log("show");
// console.log(skinCode); // console.log(skinCode);