File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/compiler-sfc/src/script Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { SFCDescriptor } from '../parse'
33import { generateCodeFrame , isArray } from '@vue/shared'
44import { type ParserPlugin , parse as babelParse } from '@babel/parser'
55import type { ImportBinding , SFCScriptCompileOptions } from '../compileScript'
6- import { DEFINE_PROPS , type PropsDestructureBindings } from './defineProps'
6+ import { DEFINE_PROPS , type PropsDestructureBindings , WITH_DEFAULTS } from './defineProps'
77import { DEFINE_MODEL , type ModelDecl } from './defineModel'
88import type { BindingMetadata } from '../../../compiler-core/src'
99import MagicString from 'magic-string'
@@ -33,6 +33,7 @@ export class ScriptCompileContext {
3333 userImports : Record < string , ImportBinding > = Object . create ( null )
3434 macrosAliases : Record < string , string | undefined > = {
3535 [ DEFINE_PROPS ] : DEFINE_PROPS ,
36+ [ WITH_DEFAULTS ] : WITH_DEFAULTS ,
3637 [ DEFINE_EMITS ] : DEFINE_EMITS ,
3738 [ DEFINE_EXPOSE ] : DEFINE_EXPOSE ,
3839 [ DEFINE_OPTIONS ] : DEFINE_OPTIONS ,
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ function processWithDefaults(
9696 node : Node ,
9797 declId ?: LVal ,
9898) : boolean {
99- if ( ! isCallOf ( node , WITH_DEFAULTS ) ) {
99+ if ( ! isCallOf ( node , ctx . macrosAliases [ WITH_DEFAULTS ] ) ) {
100100 return false
101101 }
102102 if ( ! processDefineProps ( ctx , node . arguments [ 0 ] , declId ) ) {
You can’t perform that action at this time.
0 commit comments