Skip to content

Commit

Permalink
Merge pull request #1455 from micro-zoe/dev
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
raoenhui authored Nov 26, 2024
2 parents 23de816 + d47efee commit 2a20f4e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Contact.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

欢迎小伙伴们加入micro-app微信群交流^ ^
![IMG_1210](https://github.com/user-attachments/assets/4dad4e21-7a08-43a0-ad5e-a3c4968d0b49)
![image](https://github.com/user-attachments/assets/ec331898-9222-48b9-9fd6-8a58bc9a9bf2)






Expand Down
3 changes: 2 additions & 1 deletion dev/children/vue2/src/pages/home.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<div>
<div class='logo-img'></div>
<div id="imageId" class='logo-img'></div>
<!-- <div class='outer-img'></div>
<img src="../assets/logo.png" alt=""> -->
<h3>Vue@{{version}}</h3>
<a href="#imageId">测试a标签瞄点</a>
<HelloWorld msg="Welcome to Your Vue.js App"/>
<div class='msg-title'>{{microDataStr}}</div>
<span class="iconfont">&#xe649;</span>
Expand Down
12 changes: 12 additions & 0 deletions docs/zh-cn/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
- 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)

---
### 1.0.0-rc.15

`2024-11-22`
- **Bug Fix**
- 🐞 修复removeChild异常。

### 1.0.0-rc.14

`2024-11-22`
- **Bug Fix**
- 🐞 修复 子应用a标签href为瞄点 #xxx引起异常。

### 1.0.0-rc.13

`2024-10-16`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@micro-zoe/micro-app",
"version": "1.0.0-rc.13",
"version": "1.0.0-rc.15",
"description": "A lightweight, efficient and powerful micro front-end framework",
"private": false,
"main": "lib/index.min.js",
Expand Down
4 changes: 3 additions & 1 deletion src/sandbox/iframe/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ function patchIframeAttribute (url: string, microAppWindow: microAppWindowType):
} else {
if (
((key === 'src' || key === 'srcset') && /^(img|script|video|audio|source|embed)$/i.test(this.tagName)) ||
(key === 'href' && /^(a|link|image)$/i.test(this.tagName))
(key === 'href' && /^(link|image)$/i.test(this.tagName)) ||
// If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
(key === 'href' && /^(a)$/i.test(this.tagName) && !/^#/.test(value))
) {
let _url = url
if (isBrowser && key === 'href' && /^a$/i.test(this.tagName) && isFunction(microApp.options.excludeAssetFilter) && microApp.options.excludeAssetFilter(value)) {
Expand Down
11 changes: 8 additions & 3 deletions src/source/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function invokePrototypeMethod(
return globalEnv.rawAppendChild.call(hijackParent, targetNode)
} else if (rawMethod === globalEnv.rawRemoveChild && !hijackParent.contains(targetNode)) {
if (parent.contains(targetNode)) {
return rawMethod.call(parent, targetNode)
return rawMethod.call(targetNode.parentElement, targetNode)
}
return targetNode
}
Expand Down Expand Up @@ -313,7 +313,10 @@ function completePathDynamic(app: AppInterface, newChild: Node): void {
if (newChild.hasAttribute('srcset')) {
globalEnv.rawSetAttribute.call(newChild, 'srcset', CompletionPath(newChild.getAttribute('srcset')!, app.url))
}
} else if (/^(a|link|image)$/i.test(newChild.tagName) && newChild.hasAttribute('href')) {
} else if ((/^(link|image)$/i.test(newChild.tagName) && newChild.hasAttribute('href')) ||
// If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
(/^(a)$/i.test(newChild.tagName) && newChild.hasAttribute('href') && !/^#/.test(newChild.getAttribute('href') || ''))
) {
globalEnv.rawSetAttribute.call(newChild, 'href', CompletionPath(newChild.getAttribute('href')!, app.url))
}
}
Expand Down Expand Up @@ -550,7 +553,9 @@ export function patchElementAndDocument(): void {
appInstanceMap.has(appName) &&
(
((key === 'src' || key === 'srcset') && /^(img|script|video|audio|source|embed)$/i.test(this.tagName)) ||
(key === 'href' && /^(a|link|image)$/i.test(this.tagName))
(key === 'href' && /^(link|image)$/i.test(this.tagName)) ||
// If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
(key === 'href' && /^(a)$/i.test(this.tagName) && !/^#/.test(value))
)

) {
Expand Down

0 comments on commit 2a20f4e

Please sign in to comment.