Skip to content

Commit

Permalink
feat: 支持vue微应用
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkws committed Jul 11, 2024
1 parent a36e8c1 commit 5af6c9c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"scripts": {
"start": "BROWSER=none icejs start",
"build": "icejs build",
"postbuild": "mv build/* ../",
"postbuild": "cp -rf build/* ../",
"prepublishOnly": "npm run build",
"lint": "npm run eslint && npm run stylelint",
"eslint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./",
Expand Down
6 changes: 6 additions & 0 deletions main-app/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const appConfig: IAppConfig = {
Layout: FrameworkLayout,
getApps: async () => {
const apps = [{
path: '/v3',
title: 'vue子应用',
loadScriptMode: 'import',
entry: 'https://abc.look.cloudns.biz/sub-app/v3/index.html',
},
{
path: '/seller',
title: '商家平台',
loadScriptMode: 'import',
Expand Down
4 changes: 2 additions & 2 deletions main-app/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React from 'react';
const Home = () => {
return (
<React.Fragment>
{/* <h1>home page</h1>
<h1>home page</h1>
<div><Link to="/about">About</Link></div>
<div><Link to="/seller">进入 React 微应用</Link></div> */}
<div><Link to="/v3">进入 vue 微应用</Link></div>
<a href="./person-collect/index.html" target="_blank">mine</a>
<a href="https://gist.github.com/imba-tjd/d73258f0817255dbe77d64d40d985e76" target="_blank">free</a>
<div>1</div>
Expand Down
2 changes: 1 addition & 1 deletion v-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build --base=/sub-app/v3",
"postbuild":"mv ./dist/* ../sub-app/v3",
"postbuild":"cp -rf ./dist/* ../sub-app/v3",
"serve": "vite preview"
},
"dependencies": {
Expand Down

0 comments on commit 5af6c9c

Please sign in to comment.