feat(runtime-core): set context for manual slot functions as well

This commit is contained in:
Evan You
2020-03-16 12:20:52 -04:00
parent ecd7ce60d5
commit 8a58dce603
5 changed files with 37 additions and 19 deletions

View File

@@ -494,6 +494,9 @@ const SetupProxyHandlers: { [key: string]: ProxyHandler<any> } = {}
if (__DEV__) {
markAttrsAccessed()
}
// if the user pass the slots proxy to h(), normalizeChildren should not
// attempt to attach ctx to the object
if (key === '_') return 1
return instance[type][key]
},
has: (instance, key) => key === SetupProxySymbol || key in instance[type],