Skip to content

Commit 5dc51b1

Browse files
committed
deploy: 0fc093e
1 parent 57f8d8a commit 5dc51b1

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

zh-cn/advanced.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ microApp.start({
3232
})
3333
```
3434

35+
> [!NOTE]
36+
> 需要注意的是,如果跨域请求带cookie,那么`Access-Control-Allow-Origin`不能设置为`*`,必须指定域名,同时设置`Access-Control-Allow-Credentials: true`
37+
3538
## 2、excludeRunScriptFilter: 自定义屏蔽JS加载异常
3639
通过`excludeRunScriptFilter`钩子,可选择性屏蔽JS加载异常。
3740
注意:全局捕获异常,将无法感知自定义屏蔽部分。
@@ -69,7 +72,23 @@ microApp.start({
6972
})
7073
```
7174

75+
// 配置所有子应用 a 标签的 href 自动补齐方式
76+
aHrefResolver: (hrefValue: string, appName: string, appUrl: string) => {
77+
return 'https://www.abc.com/'+ hrefValue
78+
}
79+
80+
81+
82+
## 4、aHrefResolver: 自定义处理所有子应用 a 标签的 href 拼接方式
83+
84+
```js
85+
import microApp from '@micro-zoe/micro-app'
86+
87+
microApp.start({
88+
aHrefResolver: (hrefValue: string, appName: string, appUrl: string) => {
89+
return 'https://www.abc.com/'+ hrefValue
90+
}
91+
})
92+
```
7293

7394

74-
> [!NOTE]
75-
> 需要注意的是,如果跨域请求带cookie,那么`Access-Control-Allow-Origin`不能设置为`*`,必须指定域名,同时设置`Access-Control-Allow-Credentials: true`

zh-cn/changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
---
1010

11+
12+
### 1.0.0-rc.24
13+
14+
`2025-03-19`
15+
- **Feature**
16+
- 支持 aHrefResolver: 自定义处理所有子应用 a 标签的 href 拼接方式。
17+
18+
1119
### 1.0.0-rc.23
1220

1321
`2025-03-17`

zh-cn/configure.md

+1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ microApp.start({
235235
'disable-patch-request': true, // 关闭子应用请求的自动补全功能,默认值false
236236
iframeSrc: location.origin, // 设置iframe沙箱中iframe的src地址,默认为子应用所在页面地址
237237
inheritBaseBody: true, // true: 采用基座标签 作为子应用的标签, false: 不采用
238+
aHrefResolver: (hrefValue: string, appName: string, appUrl: string) => string, // 自定义处理所有子应用 a 标签的 href 拼接方式
238239
})
239240
```
240241

0 commit comments

Comments
 (0)