Commit 6aacc9d6 authored by 琉璃丶c's avatar 琉璃丶c

1.修改页面由于使用keepAlive导致 返回键问题

parent 1cb9ed90
......@@ -14,7 +14,8 @@ const myOrder = [
name: 'orderDetail',
meta: {
title: '订单详情',
auth: false
auth: false,
keepAlive: true
},
component: resolve => require(['@/views/myOrder/detail/orderDetail'], resolve)
},
......
......@@ -91,7 +91,7 @@ export default {
}
}
},
mounted() {
activated() {
// 设置标题栏关闭返回按钮
this.$store.commit('setNavBar', {
show: true,
......@@ -102,12 +102,16 @@ export default {
leftClick: this.onBrowserBack,
rightClick: null
})
// 给window添加一个popstate事件,拦截返回键,执行this.onBrowserBack事件,addEventListener需要指向一个方法
window.addEventListener('popstate', this.onBrowserBack, false)
},
destroyed() {
deactivated() {
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window.removeEventListener('popstate', this.onBrowserBack, false)
},
mounted() {},
destroyed() {
},
methods: {
onBrowserBack() {
this.$router.go(-1)
......
......@@ -76,7 +76,8 @@ export default {
return time
}
},
mounted() {
activated() {
// let _this = this
// 设置标题栏关闭返回按钮
this.$store.commit('setNavBar', {
show: true,
......@@ -89,12 +90,16 @@ export default {
})
// 给window添加一个popstate事件,拦截返回键,执行this.onBrowserBack事件,addEventListener需要指向一个方法
window.addEventListener('popstate', this.onBrowserBack, false)
this.tabsTitleData()
},
destroyed() {
deactivated() {
// 当页面销毁必须要移除这个事件,vue不刷新页面,不移除会重复执行这个事件
window.removeEventListener('popstate', this.onBrowserBack, false)
},
mounted() {
this.tabsTitleData()
},
destroyed() {
},
methods: {
// 单个发票点击事件
orderItemAction(model) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment