禁止后退
This commit is contained in:
@@ -217,6 +217,7 @@ onBeforeMount(() => {
|
||||
// 页面挂载
|
||||
onMounted(() => {
|
||||
fontAdpat()
|
||||
stopBack()
|
||||
});
|
||||
|
||||
// 来自首页的事件
|
||||
@@ -316,6 +317,16 @@ const fontAdpat = ()=>{
|
||||
|
||||
}
|
||||
|
||||
const stopBack = ()=>{
|
||||
history.pushState(null, null, document.URL);
|
||||
|
||||
window.addEventListener('popstate', function () {
|
||||
|
||||
history.pushState(null, null, document.URL);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user