File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -676,6 +676,7 @@ export function compileScript(
676
676
677
677
let propsOption = undefined
678
678
let emitsOption = undefined
679
+ let exposeOption = undefined
679
680
if ( optionsRuntimeDecl . type === 'ObjectExpression' ) {
680
681
for ( const prop of optionsRuntimeDecl . properties ) {
681
682
if (
@@ -684,6 +685,7 @@ export function compileScript(
684
685
) {
685
686
if ( prop . key . name === 'props' ) propsOption = prop
686
687
if ( prop . key . name === 'emits' ) emitsOption = prop
688
+ if ( prop . key . name === 'expose' ) exposeOption = prop
687
689
}
688
690
}
689
691
}
@@ -700,6 +702,12 @@ export function compileScript(
700
702
emitsOption
701
703
)
702
704
}
705
+ if ( exposeOption ) {
706
+ error (
707
+ `${ DEFINE_OPTIONS } () cannot be used to declare expose. Use ${ DEFINE_EXPOSE } () instead.` ,
708
+ exposeOption
709
+ )
710
+ }
703
711
704
712
return true
705
713
}
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export function defineOptions<
169
169
Extends ,
170
170
E ,
171
171
EE
172
- > & { emits ?: undefined }
172
+ > & { emits ?: undefined ; expose ?: undefined }
173
173
) : void {
174
174
if ( __DEV__ ) {
175
175
warnRuntimeUsage ( `defineOptions` )
You can’t perform that action at this time.
0 commit comments