12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { initEditor } from "@/modules/editor";
- import { isPc } from "@queenjs/utils";
- import { defineComponent } from "vue";
- export default defineComponent(() => {
- const editor = initEditor();
- const params = new URLSearchParams(location.href.split("?")[1]);
- const id = params.get("id");
- const isSys = params.get("isSys");
- editor.actions.switchMode("preview");
- if (id) {
- editor.actions.initDesign(id, isSys?.split("#")[0]);
- editor.controls.wxCtrl.setup(window.location.href);
- editor.actions.on("initDesign:success", () => {
- const data = editor.store.designData;
- document.title = data.title;
- const shareData = {
- title: data.title,
- link: location.href,
- imgUrl: data.thumbnail || "",
- desc: data.desc,
- };
- editor.controls.wxCtrl.setShareData(shareData);
- editor.controls.wxCtrl.setShare(shareData);
- });
- }
-
-
-
-
-
- return () => (
- <div class="flex items-center justify-center h-100vh bg-gray-100">
- <div class={isPc() ? `h-668px scrollbar` : `h-full`}>
- <editor.components.Preview />
- </div>
- </div>
- );
- });
|