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(
684684
685685 let propsOption = undefined
686686 let emitsOption = undefined
687+ let exposeOption = undefined
687688 if ( optionsRuntimeDecl . type === 'ObjectExpression' ) {
688689 for ( const prop of optionsRuntimeDecl . properties ) {
689690 if (
@@ -692,6 +693,7 @@ export function compileScript(
692693 ) {
693694 if ( prop . key . name === 'props' ) propsOption = prop
694695 if ( prop . key . name === 'emits' ) emitsOption = prop
696+ if ( prop . key . name === 'expose' ) exposeOption = prop
695697 }
696698 }
697699 }
@@ -708,6 +710,12 @@ export function compileScript(
708710 emitsOption
709711 )
710712 }
713+ if ( exposeOption ) {
714+ error (
715+ `${ DEFINE_OPTIONS } () cannot be used to declare expose. Use ${ DEFINE_EXPOSE } () instead.` ,
716+ exposeOption
717+ )
718+ }
711719
712720 return true
713721 }
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export function defineOptions<
169169 Extends ,
170170 E ,
171171 EE
172- > & { emits ?: undefined }
172+ > & { emits ?: undefined ; expose ?: undefined }
173173) : void {
174174 if ( __DEV__ ) {
175175 warnRuntimeUsage ( `defineOptions` )
You can’t perform that action at this time.
0 commit comments