fix(script-setup): ensure useContext() return valid context
This commit is contained in:
@@ -746,7 +746,9 @@ const attrHandlers: ProxyHandler<Data> = {
|
||||
}
|
||||
}
|
||||
|
||||
function createSetupContext(instance: ComponentInternalInstance): SetupContext {
|
||||
export function createSetupContext(
|
||||
instance: ComponentInternalInstance
|
||||
): SetupContext {
|
||||
const expose: SetupContext['expose'] = exposed => {
|
||||
if (__DEV__ && instance.exposed) {
|
||||
warn(`expose() should be called only once per setup().`)
|
||||
|
||||
Reference in New Issue
Block a user