@@ -12,7 +12,7 @@ describe('CSS vars injection', () => {
12
12
)
13
13
expect ( content ) . toMatch ( `_useCssVars(_ctx => ({
14
14
"${ mockId } -color": (_ctx.color),
15
- "${ mockId } -font_size ": (_ctx.font.size)
15
+ "${ mockId } -font\\.size ": (_ctx.font.size)
16
16
})` )
17
17
assertCode ( content )
18
18
} )
@@ -79,14 +79,22 @@ describe('CSS vars injection', () => {
79
79
source : `.foo {
80
80
color: v-bind(color);
81
81
font-size: v-bind('font.size');
82
+
83
+ font-weight: v-bind(_φ);
84
+ font-size: v-bind(1-字号);
85
+ font-family: v-bind(フォント);
82
86
}` ,
83
87
filename : 'test.css' ,
84
88
id : 'data-v-test'
85
89
} )
86
90
expect ( code ) . toMatchInlineSnapshot ( `
87
91
".foo {
88
92
color: var(--test-color);
89
- font-size: var(--test-font_size);
93
+ font-size: var(--test-font\\\\.size);
94
+
95
+ font-weight: var(--test-_φ);
96
+ font-size: var(--test-1-字号);
97
+ font-family: var(--test-フォント);
90
98
}"
91
99
` )
92
100
} )
@@ -225,10 +233,10 @@ describe('CSS vars injection', () => {
225
233
)
226
234
expect ( content ) . toMatch ( `_useCssVars(_ctx => ({
227
235
"${ mockId } -foo": (_unref(foo)),
228
- "${ mockId } -foo____px_ ": (_unref(foo) + 'px'),
229
- "${ mockId } -_a___b____2____px_ ": ((_unref(a) + _unref(b)) / 2 + 'px'),
230
- "${ mockId } -__a___b______2___a_ ": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
231
- })` )
236
+ "${ mockId } -foo\\ \\+\\ \\'px\\' ": (_unref(foo) + 'px'),
237
+ "${ mockId } -\\(a\\ \\+\\ b\\)\\ \\/\\ 2\\ \\+\\ \\'px\\' ": ((_unref(a) + _unref(b)) / 2 + 'px'),
238
+ "${ mockId } -\\(\\(a\\ \\+\\ b\\)\\)\\ \\/\\ \\(2\\ \\*\\ a\\) ": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
239
+ })) ` )
232
240
assertCode ( content )
233
241
} )
234
242
0 commit comments