因为es模块加载与qiankun的实现方式有些冲突,所以使用本插件实现的qiankun微应用里面没有运行在js沙盒中。所以在不可避免需要设置window上的属性时,尽量显示的操作js沙盒,否则可能会对其它子应用产生副作用。qiankun沙盒使用方式 import{qiankunWindow}from'vite-plugin-qiankun/dist/helper';qiankunWindow.customxxx='...
主应用注册时AppName需保持一致plugins:[qiankun("myMicroAppName")],// 生产环境需要指定运行域名作为basebase:"http://xxx.com/",};// main.tsimport{renderWithQiankun,qiankunWindow,}from"vite-plugin-qiankun/dist/helper";// some coderenderWithQiankun({mount(props){console...
import store from './store/index' import { renderWithQiankun, qiankunWindow } from 'vite-plugin-qiankun/dist/helper' import { createRouter, createWebHistory } from 'vue-router' let router: any = null let app: any = null let history: any = null function render(props?) { let container...
重点mainjs配置 参考 import { createApp } from 'vue'import App from './App.vue'import router from './router'// pinia 仓库import { registerStore, useAppStore } from '@/store'let app = nullimport {renderWithQiankun,qiankunWindow} from 'vite-plugin-qiankun/dist/helper'const qiankunStart ...
// react main.ts 无关代码自行省略 import React from "react"; import ReactDOM from "react-dom"; import "./index.css"; import App from "./App"; // vite-plugin-qiankun helper import { renderWithQiankun, qiankunWindow } from 'vite-plugin-qiankun/dist/helper'; function render(props: ...
import{createApp}from'vue'importAppfrom'./App.vue'import{createRouter,createWebHashHistory}from'vue-router'importroutesfrom'./router'import'./public-path.js'import{renderWithQiankun,qiankunWindow}from'vite-plugin-qiankun/dist/helper'// 通过renderWithQiankun导出import{mount,unmount,bootstrap,update...
import { createApp } from 'vue' import App from './App.vue' import { store } from './store' import { renderWithQiankun, qiankunWindow } from 'vite-plugin-qiankun/dist/helper' const initQianKun = () => { renderWithQiankun({ // 当前应用在主应用中的生命周期 // 文档 https://qia...
{// 这里的 'myMicroAppName' 是子应用名,主应用注册时AppName需保持一致plugins: [qiankun('myMicroAppName')],// 生产环境需要指定运行域名作为basebase:'http://xxx.com/'}// main.tsimport{ renderWithQiankun, qiankunWindow }from'vite-plugin-qiankun/dist/helper';// some coderenderWithQiankun...
import { createApp } from "vue"; import { createPinia } from "pinia"; import router from "./router"; import { renderWithQiankun, qiankunWindow, QiankunProps, } from "vite-plugin-qiankun/dist/helper"; import { MicroAppStateActions } from "qiankun"; import Antd from "ant-design-vue"...
qiankun('subAPP',{useDevMode:true}) ], server:{port: 9000, headers:{'Access-Control-Allow-Origin':'*'}},}) 配置子应用的main.js import{qiankunWindow,renderWithQiankun}from'vite-plugin-qiankun/dist/helper';import{createApp}from'vue';importAppfrom'./App.vue';importrouterfrom'./router'...