You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
552 B
25 lines
552 B
<template>
|
|
<TopNav />
|
|
<!-- <QRCode /> -->
|
|
<router-view />
|
|
</template>
|
|
<script setup>
|
|
import TopNav from 'cpns/TopNav'
|
|
import { toAnchor } from '@/common/utils'
|
|
import { useSwiperStore } from '@/store'
|
|
import { onMounted } from 'vue'
|
|
const swiperStore = useSwiperStore()
|
|
onMounted(() => {
|
|
window.addEventListener(
|
|
'popstate',
|
|
function (event) {
|
|
if (event.state) {
|
|
const url = event.state.url
|
|
const index = toAnchor(url)
|
|
swiperStore.swiper.slideTo(index, 0, false)
|
|
}
|
|
},
|
|
false,
|
|
)
|
|
})
|
|
</script>
|