Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-sfc): should distinguish between normal script and script setup when processing css vars #3690

Closed
wants to merge 1 commit into from

Conversation

HcySunYang
Copy link
Member

Fix: #3688

@@ -112,7 +112,10 @@ export function processExpression(

const { inline, bindingMetadata } = context
const rewriteIdentifier = (raw: string, parent?: Node, id?: Identifier) => {
const type = hasOwn(bindingMetadata, raw) && bindingMetadata[raw]
const type =
bindingMetadata.__isScriptSetup !== false &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we narrow this behavior to only css vars processing?

@HcySunYang HcySunYang added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: sfc labels Apr 29, 2021
@yyx990803
Copy link
Member

This would actually disable binding optimizations for non-script-setup SFCs (e.g. optimizing _ctx.foo to $data.foo).

The proper fix should be in the css vars codegen - see 8b94464

@yyx990803 yyx990803 closed this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: sfc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Style-vars-2 v-bind feature doesn't work with Composition API
2 participants