Skip to content

Commit 1ec5850

Browse files
authored
Merge pull request jd-opensource#1574 from hdy1023/dev
fix: 子应用样式隔离属性选择器处理异常,属性选择器值丢失
2 parents b567759 + b24fab5 commit 1ec5850

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sandbox/scoped_css.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ class CSSParser {
108108
* should be ==> micro-app[name=xxx] :where(.a, .b, .c) a {}
109109
*/
110110
const attributeValues: {[key: string]: any} = {}
111+
let mockIdx = 0
111112
const matchRes = m[0].replace(/\[([^\]=]+)(?:=([^\]]+))?\]/g, (match, p1, p2) => {
112-
const mock = `__mock_${p1}Value__`
113+
const mock = `__mock_${mockIdx++}Value__`
113114
attributeValues[mock] = p2
114115
return match.replace(p2, mock)
115116
})

0 commit comments

Comments
 (0)