diff --git a/README.md b/README.md index eee9c57c..77b2cb3a 100644 --- a/README.md +++ b/README.md @@ -368,18 +368,6 @@ export default { } ``` -You may also need to augment the `SetupContext` when working with TypeScript: - -```ts -import Vue from 'vue' - -declare module '@vue/composition-api' { - interface SetupContext { - readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] } - } -} -``` - ### Reactive diff --git a/src/component/componentOptions.ts b/src/component/componentOptions.ts index c78decfc..a55a950c 100644 --- a/src/component/componentOptions.ts +++ b/src/component/componentOptions.ts @@ -1,4 +1,4 @@ -import { VNode, ComponentOptions as Vue2ComponentOptions } from 'vue' +import Vue, { VNode, ComponentOptions as Vue2ComponentOptions } from 'vue' import { Data } from './common' import { ComponentPropsOptions, ExtractPropTypes } from './componentProps' import { ComponentInstance, ComponentRenderProxy } from './componentProxy' @@ -25,7 +25,7 @@ export interface SetupContext { /** * @deprecated not avaliable in Vue 3 */ - readonly refs: Data + readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] } emit(event: string, ...args: any[]): void }