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 @@ -684,6 +684,7 @@ export function compileScript(
684
684
685
685
let propsOption = undefined
686
686
let emitsOption = undefined
687
+ let exposeOption = undefined
687
688
if ( optionsRuntimeDecl . type === 'ObjectExpression' ) {
688
689
for ( const prop of optionsRuntimeDecl . properties ) {
689
690
if (
@@ -692,6 +693,7 @@ export function compileScript(
692
693
) {
693
694
if ( prop . key . name === 'props' ) propsOption = prop
694
695
if ( prop . key . name === 'emits' ) emitsOption = prop
696
+ if ( prop . key . name === 'expose' ) exposeOption = prop
695
697
}
696
698
}
697
699
}
@@ -708,6 +710,12 @@ export function compileScript(
708
710
emitsOption
709
711
)
710
712
}
713
+ if ( exposeOption ) {
714
+ error (
715
+ `${ DEFINE_OPTIONS } () cannot be used to declare expose. Use ${ DEFINE_EXPOSE } () instead.` ,
716
+ exposeOption
717
+ )
718
+ }
711
719
712
720
return true
713
721
}
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