Просмотр исходного кода

revert transtion hook context binding behavior (fix #2287)

Evan You 10 лет назад
Родитель
Сommit
8bc85801b5

+ 1 - 2
src/directives/internal/transition.js

@@ -11,8 +11,7 @@ export default {
     // resolve on owner vm
     var hooks = resolveAsset(this.vm.$options, 'transitions', id)
     id = id || 'v'
-    // apply on closest vm
-    el.__v_trans = new Transition(el, id, hooks, this.el.__vue__ || this.vm)
+    el.__v_trans = new Transition(el, id, hooks, this.vm)
     if (oldId) {
       removeClass(el, oldId + '-transition')
     }

+ 0 - 17
test/unit/specs/directives/internal/transition_spec.js

@@ -36,23 +36,6 @@ describe('transition', function () {
     expect(dir.el.className === 'lol-transition')
   })
 
-  it('should bind the transition to closest vm', function () {
-    var vm1 = new Vue()
-    var vm2 = new Vue()
-    var el = document.createElement('div')
-    var dir = new Directive({
-      name: 'transition',
-      raw: 'test',
-      def: def,
-      modifiers: {
-        literal: true
-      }
-    }, vm1, el)
-    dir.el.__vue__ = vm2
-    dir._bind()
-    expect(dir.el.__v_trans.vm).toBe(vm2)
-  })
-
   it('dynamic transitions', function (done) {
     var el = document.createElement('div')
     document.body.appendChild(el)