12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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");
- const isWk = params.get("isWk");
- editor.actions.switchMode("preview");
- if (id) {
- if (isWk) {
- editor.actions.initWkDesign(id);
- } else {
- 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);
- });
- }
- // fetch("https://restapi.amap.com/v3/ip?key=6f53b2e09f72ad63423b2da6e08b25d7").then(response=>{
- // return response.json();
- // }).then(data=>{
- // console.log(data);
- // })
- 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>
- );
- });
|