File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/compiler-sfc/src/script Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ import { SFCDescriptor } from '../parse'
33import { generateCodeFrame } from '@vue/shared'
44import { parse as babelParse , ParserPlugin } from '@babel/parser'
55import { ImportBinding , SFCScriptCompileOptions } from '../compileScript'
6- import { DEFINE_PROPS , PropsDestructureBindings } from './defineProps'
6+ import {
7+ DEFINE_PROPS ,
8+ PropsDestructureBindings ,
9+ WITH_DEFAULTS
10+ } from './defineProps'
711import { DEFINE_MODEL , ModelDecl } from './defineModel'
812import { BindingMetadata } from '../../../compiler-core/src'
913import MagicString from 'magic-string'
@@ -32,6 +36,7 @@ export class ScriptCompileContext {
3236 userImports : Record < string , ImportBinding > = Object . create ( null )
3337 macrosAliases : Record < string , string | undefined > = {
3438 [ DEFINE_PROPS ] : DEFINE_PROPS ,
39+ [ WITH_DEFAULTS ] : WITH_DEFAULTS ,
3540 [ DEFINE_EMITS ] : DEFINE_EMITS ,
3641 [ DEFINE_EXPOSE ] : DEFINE_EXPOSE ,
3742 [ DEFINE_OPTIONS ] : DEFINE_OPTIONS ,
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ function processWithDefaults(
9393 node : Node ,
9494 declId ?: LVal
9595) : boolean {
96- if ( ! isCallOf ( node , WITH_DEFAULTS ) ) {
96+ if ( ! isCallOf ( node , ctx . macrosAliases [ WITH_DEFAULTS ] ) ) {
9797 return false
9898 }
9999 if ( ! processDefineProps ( ctx , node . arguments [ 0 ] , declId ) ) {
You can’t perform that action at this time.
0 commit comments