Skip to content

Commit

Permalink
fix(compiler-sfc): use correct importer with useCssVars (#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin authored Jul 20, 2020
1 parent 19e41ea commit 6f148d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default __define__({
exports[`SFC compile <script setup> CSS vars injection <script> w/ default export 1`] = `
"const __default__ = { setup() {} }
import { useCSSVars as __useCSSVars__ } from 'vue'
import { useCssVars as __useCssVars__ } from 'vue'
const __injectCSSVars__ = () => {
__useCssVars__(_ctx => ({ color: _ctx.color }))
}
Expand All @@ -123,7 +123,7 @@ exports[`SFC compile <script setup> CSS vars injection <script> w/ default expor
// export default {}
const __default__ = {}
import { useCSSVars as __useCSSVars__ } from 'vue'
import { useCssVars as __useCssVars__ } from 'vue'
const __injectCSSVars__ = () => {
__useCssVars__(_ctx => ({ color: _ctx.color }))
}
Expand All @@ -137,7 +137,7 @@ export default __default__"
exports[`SFC compile <script setup> CSS vars injection <script> w/ no default export 1`] = `
"const a = 1
const __default__ = {}
import { useCSSVars as __useCSSVars__ } from 'vue'
import { useCssVars as __useCssVars__ } from 'vue'
const __injectCSSVars__ = () => {
__useCssVars__(_ctx => ({ color: _ctx.color }))
}
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export function compileScript(
returned = `Object.assign(\n ${returned}\n)`
}

// inject `useCSSVars` calls
// inject `useCssVars` calls
if (hasCssVars) {
s.prepend(`import { useCssVars as __useCssVars__ } from 'vue'\n`)
for (const style of styles) {
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/genCssVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function injectCssVarsCalls(

return (
script +
`\nimport { useCSSVars as __useCSSVars__ } from 'vue'\n` +
`\nimport { useCssVars as __useCssVars__ } from 'vue'\n` +
`const __injectCSSVars__ = () => {\n${calls}}\n` +
`const __setup__ = __default__.setup\n` +
`__default__.setup = __setup__\n` +
Expand Down

0 comments on commit 6f148d0

Please sign in to comment.