fix(theme): fixed history back issue while using iOS Safari (#3658)

pull/3671/head
Timothy Lau 2 years ago
parent b50a8a1325
commit 25a0df116a

@ -5,6 +5,7 @@ import { nextTick, ref } from 'vue'
import { useData } from '../composables/data'
import { resolveTitle, type MenuItem } from '../composables/outline'
import VPDocOutlineItem from './VPDocOutlineItem.vue'
import { watch } from 'vue'
const props = defineProps<{
headers: MenuItem[]
@ -17,8 +18,12 @@ const vh = ref(0)
const main = ref<HTMLDivElement>()
const items = ref<HTMLDivElement>()
onClickOutside(main, () => {
open.value = false
watch(open, () => {
if (open.value){
onClickOutside(main, () => {
open.value = false
})
}
})
onKeyStroke('Escape', () => {

Loading…
Cancel
Save