Skip to content

Commit 27ff2f3

Browse files
authored
docs: SetupContext.refs type, remove unnecessary docs (#611)
* Update README.md * Fix type of SetupContext.ref * Remove redundant docs
1 parent 160a29b commit 27ff2f3

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,6 @@ export default {
368368
}
369369
```
370370

371-
You may also need to augment the `SetupContext` when working with TypeScript:
372-
373-
```ts
374-
import Vue from 'vue'
375-
376-
declare module '@vue/composition-api' {
377-
interface SetupContext {
378-
readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] }
379-
}
380-
}
381-
```
382-
383371
</details>
384372

385373
### Reactive

src/component/componentOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VNode, ComponentOptions as Vue2ComponentOptions } from 'vue'
1+
import Vue, { VNode, ComponentOptions as Vue2ComponentOptions } from 'vue'
22
import { Data } from './common'
33
import { ComponentPropsOptions, ExtractPropTypes } from './componentProps'
44
import { ComponentInstance, ComponentRenderProxy } from './componentProxy'
@@ -25,7 +25,7 @@ export interface SetupContext {
2525
/**
2626
* @deprecated not avaliable in Vue 3
2727
*/
28-
readonly refs: Data
28+
readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] }
2929

3030
emit(event: string, ...args: any[]): void
3131
}

0 commit comments

Comments
 (0)