mirror of
https://gitee.com/vuejs/vue.git
synced 2024-11-30 11:07:51 +08:00
make sure to expose real instance instead of proxy as vnode.context
This commit is contained in:
parent
2114cca184
commit
69abe1b726
@ -45,6 +45,7 @@ declare interface Component {
|
||||
// private properties
|
||||
_uid: number;
|
||||
_isVue: true;
|
||||
_self: Component;
|
||||
_renderProxy: Component;
|
||||
_watcher: Watcher;
|
||||
_watchers: Array<Watcher>;
|
||||
|
@ -34,6 +34,8 @@ export function initMixin (Vue: Class<Component>) {
|
||||
} else {
|
||||
vm._renderProxy = vm
|
||||
}
|
||||
// expose real self
|
||||
vm._self = vm
|
||||
initLifecycle(vm)
|
||||
initEvents(vm)
|
||||
callHook(vm, 'init')
|
||||
|
@ -34,7 +34,8 @@ export function renderElement (
|
||||
data?: VNodeData,
|
||||
namespace?: string
|
||||
): VNode | void {
|
||||
const context: Component = this
|
||||
// make sure to expose real self instead of proxy
|
||||
const context: Component = this._self
|
||||
const parent: Component | null = renderState.activeInstance
|
||||
if (!parent) {
|
||||
process.env.NODE_ENV !== 'production' && warn(
|
||||
|
Loading…
Reference in New Issue
Block a user