]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: vm._data for vuex compat
authorEvan You <yyx990803@gmail.com>
Tue, 4 May 2021 15:11:43 +0000 (11:11 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 4 May 2021 22:26:28 +0000 (18:26 -0400)
packages/runtime-core/src/compat/instance.ts

index 6b138063028c663bf53c7aedfa98bd330196adae..1f3ad8e6af9bf316f09a8e3e7bc8f4241babd9be 100644 (file)
@@ -117,9 +117,11 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
   /* istanbul ignore if */
   if (isCompatEnabled(DeprecationTypes.PRIVATE_APIS, null)) {
     extend(map, {
+      // needed by many libs / render fns
       $vnode: i => i.vnode,
 
       // inject addtional properties into $options for compat
+      // e.g. vuex needs this.$options.parent
       $options: i => {
         let res = resolveMergedOptions(i)
         if (res === i.type) res = i.type.__merged = extend({}, res)
@@ -128,6 +130,9 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
         return res
       },
 
+      // internal data access... (vuex uses this)
+      _data: i => i.data,
+
       // v2 render helpers
       $createElement: () => compatH,
       _self: i => i.proxy,