禁止后退

This commit is contained in:
tcubic 2022-08-06 00:40:17 +08:00
parent ad77e59004
commit 8c0fd1d4f1
2 changed files with 11 additions and 0 deletions

View File

@ -217,6 +217,7 @@ onBeforeMount(() => {
// //
onMounted(() => { onMounted(() => {
fontAdpat() 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>