Skip to content

Commit 956af50

Browse files
committed
feat: 优化子应用样式隔离属性选择器处理异常,属性选择器值丢失
1 parent 1ec5850 commit 956af50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/sandbox/scoped_css.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ 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
112-
const matchRes = m[0].replace(/\[([^\]=]+)(?:=([^\]]+))?\]/g, (match, p1, p2) => {
113-
const mock = `__mock_${mockIdx++}Value__`
111+
const matchRes = m[0].replace(/\[([^\]=]+)(?:=([^\]]+))?\]/g, (match, p1, p2, offset) => {
112+
const mock = `__mock_${p1}_${offset}Value__`
114113
attributeValues[mock] = p2
115114
return match.replace(p2, mock)
116115
})

0 commit comments

Comments
 (0)