fix(compiler-sfc): support complex expression in CSS v-bind() (#5114)
fix #5109
This commit is contained in:
@@ -66,6 +66,27 @@ return { color, width }
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`CSS vars injection codegen should work with w/ complex expression 1`] = `
|
||||
"import { useCssVars as _useCssVars, unref as _unref } from 'vue'
|
||||
|
||||
export default {
|
||||
setup(__props, { expose }) {
|
||||
expose();
|
||||
|
||||
_useCssVars(_ctx => ({
|
||||
\\"xxxxxxxx-_a___b____2____px__\\": ((_unref(a) + _unref(b)) / 2 + 'px' ),
|
||||
\\"xxxxxxxx-__a___b______2___a_\\": (((_unref(a) + _unref(b))) / (2 * _unref(a)))
|
||||
}))
|
||||
|
||||
let a = 100
|
||||
let b = 200
|
||||
|
||||
return { a, b }
|
||||
}
|
||||
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`CSS vars injection codegen w/ <script setup> 1`] = `
|
||||
"import { useCssVars as _useCssVars, unref as _unref } from 'vue'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user