feat(compiler-sfc): new SFC css varaible injection implementation
ref: https://github.com/vuejs/rfcs/pull/231
This commit is contained in:
@@ -215,9 +215,10 @@ export function generate(
|
||||
}
|
||||
|
||||
// binding optimizations
|
||||
const optimizeSources = options.bindingMetadata
|
||||
? `, $props, $setup, $data, $options`
|
||||
: ``
|
||||
const optimizeSources =
|
||||
options.bindingMetadata && !options.inline
|
||||
? `, $props, $setup, $data, $options`
|
||||
: ``
|
||||
// enter render function
|
||||
if (!ssr) {
|
||||
if (isSetupInlined) {
|
||||
|
||||
@@ -113,17 +113,16 @@ export function processExpression(
|
||||
// it gets correct type
|
||||
return `__props.${raw}`
|
||||
}
|
||||
}
|
||||
|
||||
if (type === BindingTypes.CONST) {
|
||||
// setup const binding in non-inline mode
|
||||
return `$setup.${raw}`
|
||||
} else if (type) {
|
||||
return `$${type}.${raw}`
|
||||
} else {
|
||||
// fallback to ctx
|
||||
return `_ctx.${raw}`
|
||||
if (type === BindingTypes.CONST) {
|
||||
// setup const binding in non-inline mode
|
||||
return `$setup.${raw}`
|
||||
} else if (type) {
|
||||
return `$${type}.${raw}`
|
||||
}
|
||||
}
|
||||
// fallback to ctx
|
||||
return `_ctx.${raw}`
|
||||
}
|
||||
|
||||
// fast path if expression is a simple identifier.
|
||||
|
||||
Reference in New Issue
Block a user