App.vue 481 B

123456789101112131415161718192021
  1. <template>
  2. <router-view v-loading="false" />
  3. </template>
  4. <script lang="ts" setup>
  5. import { api as viewerApi } from 'v-viewer';
  6. import 'viewerjs/dist/viewer.css';
  7. import { MESSAGE_KEY } from './types';
  8. window.addEventListener('message', (e) => {
  9. switch (e.data.type) {
  10. case MESSAGE_KEY.SHOW_VIEWER:
  11. viewerApi({ images: e.data.images, options: { zIndex: 9999 } });
  12. break;
  13. }
  14. });
  15. </script>
  16. <style lang="scss">
  17. @use './app.scss';
  18. </style>