Skip to content

Commit e4bc5ab

Browse files
Doctor-wusxzz
authored andcommitted
Revert "feat(runtime-vapor): add setup ctx type"
This reverts commit b385157.
1 parent 20aa749 commit e4bc5ab

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

packages/runtime-vapor/src/apiSetup.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { proxyRefs } from '@vue/reactivity'
2-
import { type Data, isArray, isFunction, isObject } from '@vue/shared'
2+
import { isArray, isFunction, isObject } from '@vue/shared'
33
import { type ComponentInternalInstance, setCurrentInstance } from './component'
44
import { getAttrsProxy } from './componentAttrs'
5+
// import { SetupContext } from 'vue'
56
import { type Block, fragmentKey } from './apiRender'
6-
import type { EmitFn, EmitsOptions } from './componentEmits'
7-
8-
export type SetupContext<E = EmitsOptions> = E extends any
9-
? {
10-
attrs: Data
11-
emit: EmitFn<E>
12-
expose: (exposed?: Record<string, any>) => void
13-
}
14-
: never
157

168
export function setupComponent(instance: ComponentInternalInstance): void {
179
const reset = setCurrentInstance(instance)
@@ -50,9 +42,7 @@ export function setupComponent(instance: ComponentInternalInstance): void {
5042
reset()
5143
}
5244

53-
export function createSetupContext(
54-
instance: ComponentInternalInstance,
55-
): SetupContext {
45+
export function createSetupContext(instance: ComponentInternalInstance): any {
5646
if (__DEV__) {
5747
// We use getters in dev in case libs like test-utils overwrite instance
5848
// properties (overwrites should not be done in prod)
@@ -67,7 +57,6 @@ export function createSetupContext(
6757
})
6858
} else {
6959
return {
70-
expose: () => {},
7160
get attrs() {
7261
return getAttrsProxy(instance)
7362
},

0 commit comments

Comments
 (0)