mirror of https://github.com/vuejs/core.git
fix(compiler-sfc): use prependLeft to handle CSSVars (#7760)
This commit is contained in:
parent
b9dc1adefb
commit
139104ba26
|
@ -255,5 +255,22 @@ describe('CSS vars injection', () => {
|
|||
)
|
||||
expect(cssVars).toMatchObject([`count.toString(`, `xxx`])
|
||||
})
|
||||
|
||||
// #7759
|
||||
test('It should correctly parse the case where there is no space after the script tag', () => {
|
||||
const { content } = compileSFCScript(
|
||||
`<script setup>import { ref as _ref } from 'vue';
|
||||
let background = _ref('red')
|
||||
</script>
|
||||
<style>
|
||||
label {
|
||||
background: v-bind(background);
|
||||
}
|
||||
</style>`
|
||||
)
|
||||
expect(content).toMatch(
|
||||
`export default {\n setup(__props, { expose }) {\n expose();\n\n_useCssVars(_ctx => ({\n "xxxxxxxx-background": (_unref(background))\n}))`
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue