mirror of https://github.com/vuejs/core.git
fix: defineExpose type definition and runtime warning
This commit is contained in:
parent
be0f614ac0
commit
1675b6d723
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue