Skip to content

Commit

Permalink
test: add missing edge case for css v-bind
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 23, 2022
1 parent 16fa18d commit 059c63e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -75,6 +75,7 @@ export default {
_useCssVars(_ctx => ({
\\"xxxxxxxx-foo\\": (_unref(foo)),
\\"xxxxxxxx-foo____px_\\": (_unref(foo) + 'px'),
\\"xxxxxxxx-_a___b____2____px_\\": ((_unref(a) + _unref(b)) / 2 + 'px'),
\\"xxxxxxxx-__a___b______2___a_\\": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
}))
Expand Down
2 changes: 2 additions & 0 deletions packages/compiler-sfc/__tests__/cssVars.spec.ts
Expand Up @@ -210,6 +210,7 @@ describe('CSS vars injection', () => {
p{
width: calc(v-bind(foo) - 3px);
height: calc(v-bind('foo') - 3px);
top: calc(v-bind(foo + 'px') - 3px);
}
div {
color: v-bind((a + b) / 2 + 'px' );
Expand All @@ -224,6 +225,7 @@ describe('CSS vars injection', () => {
)
expect(content).toMatch(`_useCssVars(_ctx => ({
"${mockId}-foo": (_unref(foo)),
"${mockId}-foo____px_": (_unref(foo) + 'px'),
"${mockId}-_a___b____2____px_": ((_unref(a) + _unref(b)) / 2 + 'px'),
"${mockId}-__a___b______2___a_": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
})`)
Expand Down

0 comments on commit 059c63e

Please sign in to comment.