File tree 1 file changed +10
-0
lines changed
packages/runtime-core/src/compat
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
37
37
import { resolveFilter } from '../helpers/resolveAssets'
38
38
import { InternalSlots , Slots } from '../componentSlots'
39
39
import { ContextualRenderFn } from '../componentRenderContext'
40
+ import { resolveMergedOptions } from '../componentOptions'
40
41
41
42
export type LegacyPublicInstance = ComponentPublicInstance &
42
43
LegacyPublicProperties
@@ -127,6 +128,15 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
127
128
// needed by many libs / render fns
128
129
$vnode : i => i . vnode ,
129
130
131
+ // inject addtional properties into $options for compat
132
+ // e.g. vuex needs this.$options.parent
133
+ $options : i => {
134
+ const res = extend ( { } , resolveMergedOptions ( i ) )
135
+ res . parent = i . proxy ! . $parent
136
+ res . propsData = i . vnode . props
137
+ return res
138
+ } ,
139
+
130
140
// some private properties that are likely accessed...
131
141
_self : i => i . proxy ,
132
142
_uid : i => i . uid ,
You can’t perform that action at this time.
0 commit comments