index.ts 720 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { markRaw, reactive } from "vue";
  2. import VR from "./vr.vue";
  3. import { Scene } from "../../platform-resource";
  4. type Props = {
  5. title: string;
  6. width: string;
  7. visiable: boolean;
  8. height?: string;
  9. content: any;
  10. submit: (info: Scene) => void;
  11. cancel: () => void;
  12. };
  13. export const props = reactive({
  14. title: "全景VR",
  15. width: "500px",
  16. }) as Props;
  17. export const selectScene = () =>
  18. new Promise<Scene>((resolve, reject) => {
  19. props.content = markRaw(VR);
  20. props.title = "全景VR";
  21. props.visiable = true;
  22. props.submit = (info) => {
  23. resolve(info);
  24. props.visiable = false;
  25. };
  26. props.cancel = () => {
  27. reject("cancel");
  28. props.visiable = false;
  29. };
  30. });