wip: remove unnecessary inlinePropsIdentifier option
This commit is contained in:
@@ -66,10 +66,7 @@ export interface CodegenResult {
|
||||
}
|
||||
|
||||
export interface CodegenContext
|
||||
extends Omit<
|
||||
Required<CodegenOptions>,
|
||||
'bindingMetadata' | 'inline' | 'inlinePropsIdentifier'
|
||||
> {
|
||||
extends Omit<Required<CodegenOptions>, 'bindingMetadata' | 'inline'> {
|
||||
source: string
|
||||
code: string
|
||||
line: number
|
||||
|
||||
@@ -91,10 +91,6 @@ interface SharedTransformCodegenOptions {
|
||||
* This allows the function to directly access setup() local bindings.
|
||||
*/
|
||||
inline?: boolean
|
||||
/**
|
||||
* Identifier for props in setup() inline mode.
|
||||
*/
|
||||
inlinePropsIdentifier?: string
|
||||
}
|
||||
|
||||
export interface TransformOptions extends SharedTransformCodegenOptions {
|
||||
|
||||
@@ -125,7 +125,6 @@ export function createTransformContext(
|
||||
ssrCssVars = ``,
|
||||
bindingMetadata = EMPTY_OBJ,
|
||||
inline = false,
|
||||
inlinePropsIdentifier = `$props`,
|
||||
onError = defaultOnError
|
||||
}: TransformOptions
|
||||
): TransformContext {
|
||||
@@ -145,7 +144,6 @@ export function createTransformContext(
|
||||
ssrCssVars,
|
||||
bindingMetadata,
|
||||
inline,
|
||||
inlinePropsIdentifier,
|
||||
onError,
|
||||
|
||||
// state
|
||||
|
||||
@@ -98,14 +98,12 @@ export function processExpression(
|
||||
return node
|
||||
}
|
||||
|
||||
const { inline, inlinePropsIdentifier, bindingMetadata } = context
|
||||
const { inline, bindingMetadata } = context
|
||||
const prefix = (raw: string) => {
|
||||
const type = hasOwn(bindingMetadata, raw) && bindingMetadata[raw]
|
||||
if (inline) {
|
||||
// setup inline mode
|
||||
if (type === 'props') {
|
||||
return `${inlinePropsIdentifier}.${raw}`
|
||||
} else if (type === 'setup') {
|
||||
if (type === 'setup') {
|
||||
return `${context.helperString(UNREF)}(${raw})`
|
||||
} else if (type === 'component-import') {
|
||||
return raw
|
||||
|
||||
Reference in New Issue
Block a user