123456789101112131415161718192021222324252627282930313233 |
- import { initRemSize } from "@/hooks/initRemSize";
- import { initEditor } from "@/modules/editor";
- import { defineComponent, onMounted } from "vue";
- import WxSdk from "./sdk";
- export const App = defineComponent(() => {
- const editor = initEditor();
- const params = new URLSearchParams(location.href.split("?")[1]);
- const id = params.get("id");
- editor.actions.switchMode("preview");
- initRemSize();
- if (id) {
- editor.actions.initDesign(id);
- editor.actions.on("initDesign:success", () => {
- const data = editor.store.designData;
- WxSdk.setShareData({
- title: data.title,
- link: location.href,
- imgUrl: data.thumbnail || "",
- desc: data.title,
- });
- });
- }
- onMounted(() => {
- WxSdk.init();
- });
- return () => <editor.components.Preview />;
- });
|