App.vue 827 B

123456789101112131415161718192021222324252627282930313233343536
  1. <script setup lang="ts">
  2. import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
  3. import { navigateToInterceptor } from '@/router/interceptor'
  4. import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
  5. onLaunch((options) => {
  6. // 处理直接进入页面路由的情况:如h5直接输入路由、微信小程序分享后进入等
  7. // https://github.com/unibest-tech/unibest/issues/192
  8. console.log('App Launch options: ', options)
  9. const gotoPath = options?.path || ''
  10. navigateToInterceptor.invoke({ url: gotoPath })
  11. })
  12. onShow((options) => {
  13. console.log('App Show', options)
  14. })
  15. onHide(() => {
  16. console.log('App Hide')
  17. })
  18. </script>
  19. <style lang="scss">
  20. swiper,
  21. scroll-view {
  22. flex: 1;
  23. height: 100%;
  24. overflow: hidden;
  25. }
  26. image {
  27. width: 100%;
  28. height: 100%;
  29. vertical-align: middle;
  30. }
  31. </style>