feat: expose compiler APIs

This commit is contained in:
Evan You
2019-09-20 00:12:37 -04:00
parent 3b5ef483a9
commit d7aab859a3
7 changed files with 70 additions and 10 deletions

View File

@@ -77,6 +77,14 @@ export const PublicInstanceProxyHandlers = {
}
}
},
has(target: ComponentInternalInstance, key: string): boolean {
const { renderContext, data, props } = target
return (
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
hasOwn(renderContext, key) ||
hasOwn(props, key)
)
},
set(target: ComponentInternalInstance, key: string, value: any): boolean {
const { data, renderContext } = target
if (data !== EMPTY_OBJ && hasOwn(data, key)) {