Skip to content

Commit be1b79d

Browse files
committed
chore: Update docs & readme.md
1 parent bbbc63d commit be1b79d

File tree

12 files changed

+28
-23
lines changed

12 files changed

+28
-23
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*.error
88
*.log
99
*.lock
10-
createPortalApp.js
11-
interface.js
10+
package-lock.json

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019-present, Vuchan(Giving) Wu
1+
Copyright (c) 2019-present, Giving(Vuchan) Wu
22

33
"Anti 996" License Version 1.0 (Draft)
44

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ ___________
1717
| | | |__
1818
```
1919

20+
## Architecture
21+
22+
[快速实现一个基于 Vue.js 的微前端应用](https://www.cnblogs.com/givingwu/p/12900255.html)
23+
24+
![vue-mfe-architecture](docs/.vuepress/public/images/vue-mfe-architecture.png)
25+
2026
## Documentation
2127

2228
Docs are available at https://vue-mfe.netlify.com/ - I am still working on refining it and contributions are welcome!

build/configs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const libraryName = process.env.LIBRARY_NAME || package.name
1414

1515
const banner = `/*!
1616
* ${libraryName} v${version}
17-
* (c) ${new Date().getFullYear()} Vuchan
17+
* (c) ${new Date().getFullYear()} GivingWu
1818
* @license MIT
1919
*/`
2020

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
serviceWorker: true,
55

66
themeConfig: {
7-
repo: 'vuchan/vue-mfe',
7+
repo: 'givingwu/vue-mfe',
88
docsDir: 'docs',
99
lastUpdated: 'Last Updated',
1010
nav: [
-144 KB
Binary file not shown.
577 KB
Loading

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ features:
1111
- title: 够易用
1212
details: 除了懒装载路由和应用资源其他的都不做
1313

14-
footer: MIT License | Copyright © 2019-present Vuchan
14+
footer: MIT License | Copyright © 2019-present GivingWu
1515
---

docs/guide/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Vue-MFE 实现的微前端原理是基于基座(VueMfe App)。
3636
4. 动态装载 **微前端子应用`SubApp`** 的静态资源和路由
3737
5. 跳转到用户访问的路由`prefix`实现完整闭环
3838

39-
![vue-mfe-architecture.jpg](../.vuepress/public/images/vue-mfe-architecture.jpg)
39+
![vue-mfe-architecture](../.vuepress/public/images/vue-mfe-architecture.png)
4040

4141
## installation
4242

docs/guide/getting-started.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lang: zh-CN
3939
::: tip
4040
子应用打包成 UMD 格式的主要原因是为了维护一个统一的 webpack build context。主运行时在 PRD 上跑的是 webpack 构建后的 bundle 代码,而子应用也支持被独立构建,那么变成了两个独立的 webpack build context 构建生成的 bundle。当时没有找到好的解决办法,所有用 UMD 上了。而后续在写 `VueMfe.Lazy` 的时候看到了社区有一种实现方式是使用 XHR 把 JS 文件请求到后使用 `new Function(require, exports, ${ XHRResponse.bodyText })` 拼接后执行。类似这样 [httpVueLoader ScriptContext.compile](https://github.com/FranckFreiburger/http-vue-loader/blob/master/src/httpVueLoader.js#L161),但感觉还是没有 UMD 简单方便。
4141
:::
42-
- build 的入口**必须是执行 `VueMfe.createApp`的文件**。 (因为该资源会被 [loader](https://github.com/vuchan/vue-mfe/blob/master/src/helpers/loader.js#L15) 通过 UMD 的暴露的全局变量动态装载。
42+
- build 的入口**必须是执行 `VueMfe.createApp`的文件**。 (因为该资源会被 [loader](https://github.com/givingwu/vue-mfe/blob/master/src/helpers/loader.js#L15) 通过 UMD 的暴露的全局变量动态装载。
4343
::: warning
4444
路由的根路由必须以 `/${prefix}/` 开始,且 `${prefix}` 不能存在与另一 SubApp 的 prefix 重复,否则会抛出 `registerRoutes` 失败的错误。
4545
:::
@@ -50,7 +50,7 @@ lang: zh-CN
5050

5151
### createApp
5252

53-
`VueMfe.createApp({}: AppConfig): void` 创建 VueMfe 主(基座)应用,后续所有的 SubApp 都将被注册和装载到该应用。 [source code](https://github.com/vuchan/vue-mfe/blob/master/src/index.js#L41)
53+
`VueMfe.createApp({}: AppConfig): void` 创建 VueMfe 主(基座)应用,后续所有的 SubApp 都将被注册和装载到该应用。 [source code](https://github.com/givingwu/vue-mfe/blob/master/src/index.js#L41)
5454

5555
```javascript {38}
5656
import VueMfe from 'vue-mfe'
@@ -100,7 +100,7 @@ export default VueMfe.createApp({
100100

101101
### createSubApp
102102

103-
`SubAppConfig: createSubApp({}: SubAppConfig)` 创建一个 VueMfe SubApp 子应用。可以暴露任意组件给其他应用(App 和 SubApp)使用。[source code](https://github.com/vuchan/vue-mfe/blob/master/src/index.js#L84)
103+
`SubAppConfig: createSubApp({}: SubAppConfig)` 创建一个 VueMfe SubApp 子应用。可以暴露任意组件给其他应用(App 和 SubApp)使用。[source code](https://github.com/givingwu/vue-mfe/blob/master/src/index.js#L84)
104104

105105
```javascript {26}
106106
import VueMfe from 'vue-mfe'
@@ -157,7 +157,7 @@ export default VueMfe.createSubApp({
157157

158158
### isInstalled
159159

160-
`VueMfe.isInstalled(prefix: string): boolean` 当前应用是否已被安装过。 [source code](https://github.com/vuchan/vue-mfe/blob/master/src/core/app/status.js#L10)
160+
`VueMfe.isInstalled(prefix: string): boolean` 当前应用是否已被安装过。 [source code](https://github.com/givingwu/vue-mfe/blob/master/src/core/app/status.js#L10)
161161

162162
```javascript
163163
import VueMfe from 'vue-mfe'
@@ -171,7 +171,7 @@ if (VueMfe.isInstall('prefix')) {
171171

172172
### Lazy
173173

174-
`VueMfe.Lazy(path: string): Promise<any>` 远程加载一个 Module,可以是任意合法的 JavaScript 对象。[source code](https://github.com/vuchan/vue-mfe/blob/master/src/core/lazy.js#L25)
174+
`VueMfe.Lazy(path: string): Promise<any>` 远程加载一个 Module,可以是任意合法的 JavaScript 对象。[source code](https://github.com/givingwu/vue-mfe/blob/master/src/core/lazy.js#L25)
175175

176176
::: warning
177177
在 VueMfe.Lazy 被其他 SubApp 调用之前,SubApp Demo 必须先暴露 Example 组件并打包成 UMD 格式并配置到 App Resource 中。
@@ -225,13 +225,13 @@ export default {
225225

226226
## DEMO
227227

228-
- [App](https://github.com/vuchan/vue-mfe/blob/master/example/root-app/src/main.js)
229-
- [SubApp](https://github.com/vuchan/vue-mfe/blob/master/example/sub-app-demo/main.js)
230-
- [Lazy](https://github.com/vuchan/vue-mfe/blob/master/example/sub-app-lazy/src/views/async.vue)
228+
- [App](https://github.com/givingwu/vue-mfe/blob/master/example/root-app/src/main.js)
229+
- [SubApp](https://github.com/givingwu/vue-mfe/blob/master/example/sub-app-demo/main.js)
230+
- [Lazy](https://github.com/givingwu/vue-mfe/blob/master/example/sub-app-lazy/src/views/async.vue)
231231

232232
```bash
233233
# pull repo
234-
git clone https://github.com/vuchan/vue-mfe.git
234+
git clone https://github.com/givingwu/vue-mfe.git
235235
cd vue-mfe
236236

237237
# 安装依赖

0 commit comments

Comments
 (0)