File tree Expand file tree Collapse file tree 6 files changed +2919
-3195
lines changed Expand file tree Collapse file tree 6 files changed +2919
-3195
lines changed Original file line number Diff line number Diff line change @@ -72,23 +72,26 @@ microApp.start({
7272})
7373```
7474
75- // 配置所有子应用 a 标签的 href 自动补齐方式
76- aHrefResolver: (hrefValue: string, appName: string, appUrl: string) => {
77- return 'https://www.abc.com/'+ hrefValue
78- }
79-
80-
81-
8275## 4、aHrefResolver: 自定义处理所有子应用 a 标签的 href 拼接方式
83-
8476``` js
8577import microApp from ' @micro-zoe/micro-app'
8678
8779microApp .start ({
80+ // 配置所有子应用 a 标签的 href 自动补齐方式
8881 aHrefResolver : (hrefValue : string , appName : string , appUrl : string ) => {
8982 return ' https://www.abc.com/' + hrefValue
9083 }
9184})
9285```
9386
87+ ## escapeIframeWindowEvents : iframe 模式 逃逸沙盒的window事件
88+ ``` js
89+ import microApp from ' @micro-zoe/micro-app'
90+
91+ microApp .start ({
92+ // 子应用的
93+ escapeIframeWindowEvents: [' message' ]
94+ })
95+ ```
96+
9497
Original file line number Diff line number Diff line change 77- 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)
88
99---
10+ ### 1.0.0-rc.25
1011
11-
12+ ` 2025-05-23 `
13+ - ** Feature**
14+ - 支持escapeIframeWindowEvents : iframe 模式 逃逸沙盒的window事件。
15+ - ** Bug Fix**
16+ - 🐞 修复 子应用样式加载异常,[ issue 1553] ( https://github.com/jd-opensource/micro-app/issues/1553 ) 。
17+ - 🐞 修复 当开启样式隔离时子应用属性选择器样式错误,[ issue 1573] ( https://github.com/jd-opensource/micro-app/issues/1573 ) 。
1218### 1.0.0-rc.24
1319
1420` 2025-03-19 `
Original file line number Diff line number Diff line change 11{
22 "name" : " @micro-zoe/micro-app" ,
3- "version" : " 1.0.0-rc.24 " ,
3+ "version" : " 1.0.0-rc.25 " ,
44 "description" : " A lightweight, efficient and powerful micro front-end framework" ,
55 "private" : false ,
66 "main" : " lib/index.min.js" ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 escape2RawWindowRegExpKeys ,
2626} from './special_key'
2727import WorkerProxy from '../../proxies/worker'
28+ import microApp from '../../micro_app'
2829
2930/**
3031 * patch window of child app
@@ -234,7 +235,12 @@ function patchWindowEffect (microAppWindow: microAppWindowType): CommonEffectHoo
234235 * TODO: SCOPE_WINDOW_EVENT_OF_IFRAME的事件非常少,有可能导致问题
235236 * 1、一些未知的需要绑定到iframe的事件被错误的绑定到原生window上
236237 */
237- return SCOPE_WINDOW_EVENT_OF_IFRAME . includes ( type ) ? microAppWindow : rawWindow
238+ let escapeSandboxEvent : Array < string > = [ ]
239+ if ( Array . isArray ( microApp ?. options ?. escapeIframeWindowEvents ) ) {
240+ escapeSandboxEvent = microApp ?. options ?. escapeIframeWindowEvents
241+ }
242+ const scopeWindowEvent = SCOPE_WINDOW_EVENT_OF_IFRAME . filter ( item => ! escapeSandboxEvent . includes ( item ) )
243+ return scopeWindowEvent . includes ( type ) ? microAppWindow : rawWindow
238244 }
239245
240246 // TODO: listener 是否需要绑定microAppWindow,否则函数中的this指向原生window
Original file line number Diff line number Diff line change @@ -369,7 +369,8 @@ declare module '@micro-app/types' {
369369 getRootElementParentNode ?: ( node : Node , appName : AppName ) => void
370370 customProxyDocumentProps ?: Map < string | number | symbol , ( value : unknown ) => void >
371371 aHrefResolver ?: ( hrefValue : string , appName : string , appUrl : string ) => string
372- inheritBaseBody ?:boolean
372+ inheritBaseBody ?:boolean ,
373+ escapeIframeWindowEvents ? : Array < string > ,
373374 }
374375
375376 // MicroApp config
You can’t perform that action at this time.
0 commit comments