From 50c777f46144ca163ac6ab00a22b536f4ab33ffd Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期四, 02 一月 2025 18:49:44 +0800
Subject: [PATCH] hebing

---
 src/main.js |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/main.js b/src/main.js
index 61b404b..78d9e95 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,16 +1,18 @@
 import Vue from "vue";
 import App from "./App.vue";
 import less from "less";
-import "./assets/style/main.css";
 import ElementUI from "element-ui";
 import "element-ui/lib/theme-chalk/index.css";
 import store from "./store";
+// 鍏紡杈撳叆
+import { MathfieldElement } from "mathlive"
 
 Vue.config.productionTip = false;
 
 // 鑷畾涔夐厤缃�
 import config from "@/assets/js/config";
 Vue.prototype.config = config;
+// Vue.prototype.thisBookConfig = await config.getBookConfig();
 
 // 璇锋眰澶勭悊
 import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
@@ -30,7 +32,10 @@
 let instance = null;
 
 function render(props = {}) {
-  const { container } = props;
+  const { container, onGlobalStateChange, setGlobalState } = props;
+  Vue.prototype.onGlobalStateChange = onGlobalStateChange;
+  Vue.prototype.setGlobalState = setGlobalState;
+  Vue.prototype.container = container;
   instance = new Vue({
     // router,
     store,
@@ -46,6 +51,18 @@
 // qiankun
 export async function bootstrap() {}
 export async function mount(props) {
+  console.log(props, "瀛愬眰propspropspropsprops");
+  props.onGlobalStateChange((state, prev) => {
+    // state: 鍙樻洿鍚庣殑鐘舵��; prev 鍙樻洿鍓嶇殑鐘舵��
+    console.log("瀛愬眰鍙樺寲锛�", state, prev);
+    // 鐘舵�佸彉鍖栧悓姝uex锛岀敤浜庡悇椤甸潰璋冪敤
+    store.commit("setQiankun", state);
+  });
+
+  // props.setGlobalState({
+  //   state: 3, // 搴旂敤鎸傝浇瀹屾垚锛屽悓鏃剁敤浜庤Е鍙戜竴娆tateChange灏唖tate鎸傝浇鍦╲uex褰撲腑
+  // });
+
   render(props);
 }
 export async function unmount() {
@@ -54,7 +71,7 @@
   instance = null;
 }
 
-new Vue({
-  store,
-  render: (h) => h(App)
-}).$mount("#app");
+// 澧炲姞 update 閽╁瓙浠ヤ究涓诲簲鐢ㄦ墜鍔ㄦ洿鏂板井搴旂敤
+// export async function update(props) {
+//   render(props);
+// }

--
Gitblit v1.9.1