App.vue 472 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div>
  3. <router-view />
  4. </div>
  5. </template>
  6. <script setup lang="ts">
  7. import { handWs } from '@/utils/handWs'
  8. const router = useRouter();
  9. /**
  10. * 手势
  11. */
  12. const getHandWs = () => {
  13. //加载手势WS
  14. handWs((e: any) => {
  15. // console.log("eeee", e)
  16. //刷新
  17. if (e?.data?.result == "refresh") {
  18. router.push({ path: '/gesture' });
  19. //刷新
  20. window.location.reload()
  21. }
  22. });
  23. };
  24. getHandWs()
  25. </script>
  26. <style scoped></style>