Skip to content

Commit

Permalink
fix: defineExpose type definition and runtime warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 25, 2021
1 parent be0f614 commit 1675b6d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/runtime-core/src/apiSetupHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ export function defineEmits() {
*/
export const defineEmit = defineEmits

export function defineExpose(exposed?: Record<string, any>) {
if (__DEV__) {
warn(
`defineExpose() is a compiler-hint helper that is only usable inside ` +
`<script setup> of a single file component. Its usage should be ` +
`compiled away and calling it at runtime has no effect.`
)
}
}

/**
* @deprecated use `useSlots` and `useAttrs` instead.
*/
Expand Down

0 comments on commit 1675b6d

Please sign in to comment.