Skip to content

Commit b24fab5

Browse files
author
hdy1023
committed
fix: 子应用样式隔离属性选择器处理异常,属性选择器值丢失
1 parent b567759 commit b24fab5

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)