一、原因前言
二、解决办法
<template>
<div class="end_judging_scrap_steel">
<t-header title="废钢终判" :back="goBack">
<template #right>
<div @click="goToHistory" class="history">历史记录</div>
</template>
</t-header>
</div>
</template>
<script>
export default {
name: 'endJudgingScrapSteel',
data() {
return {
}
},
beforeDestroy() {
window.removeEventListener('popstate', this.goBack, false)
},
mounted() {
if (window.history && window.history.pushState) {
history.pushState(null, null, location.href)
window.addEventListener('popstate', this.goBack, false)
}
},
methods: {
goBack() {
this.$router.push({ path: '/' });
}
},
};
</script>