hjyd
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

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <TopNav />
  3. <!-- <QRCode /> -->
  4. <router-view />
  5. </template>
  6. <script setup>
  7. import TopNav from 'cpns/TopNav'
  8. import { toAnchor } from '@/common/utils'
  9. import { useSwiperStore } from '@/store'
  10. import { onMounted } from 'vue'
  11. const swiperStore = useSwiperStore()
  12. onMounted(() => {
  13. window.addEventListener(
  14. 'popstate',
  15. function (event) {
  16. if (event.state) {
  17. const url = event.state.url
  18. const index = toAnchor(url)
  19. swiperStore.swiper.slideTo(index, 0, false)
  20. }
  21. },
  22. false,
  23. )
  24. })
  25. </script>