Skip to content

Commit bf8886a

Browse files
committed
fix fragment transition context (fix #1295)
1 parent cb66ddd commit bf8886a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/fragment/fragment.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var transition = require('../transition')
1515
function Fragment (linker, vm, frag, host, scope, parentFrag) {
1616
this.children = []
1717
this.childFrags = []
18+
this.vm = vm
1819
this.scope = scope
1920
this.inserted = false
2021
this.parentFrag = parentFrag
@@ -73,7 +74,7 @@ function singleBefore (target, trans) {
7374
var method = trans !== false
7475
? transition.before
7576
: _.before
76-
method(this.node, target, this.scope)
77+
method(this.node, target, this.vm)
7778
this.inserted = true
7879
if (_.inDoc(this.node)) {
7980
this.callHook(attach)
@@ -86,7 +87,7 @@ function singleBefore (target, trans) {
8687

8788
function singleRemove () {
8889
var shouldCallRemove = _.inDoc(this.node)
89-
transition.remove(this.node, this.scope)
90+
transition.remove(this.node, this.vm)
9091
this.inserted = false
9192
if (shouldCallRemove) {
9293
this.callHook(detach)
@@ -103,12 +104,12 @@ function singleRemove () {
103104
function multiBefore (target, trans) {
104105
_.before(this.node, target)
105106
var nodes = this.nodes
106-
var scope = this.scope
107+
var vm = this.vm
107108
var method = trans !== false
108109
? transition.before
109110
: _.before
110111
for (var i = 0, l = nodes.length; i < l; i++) {
111-
method(nodes[i], target, scope)
112+
method(nodes[i], target, vm)
112113
}
113114
_.before(this.end, target)
114115
this.inserted = true
@@ -126,12 +127,12 @@ function multiRemove () {
126127
var parent = this.node.parentNode
127128
var node = this.node.nextSibling
128129
var nodes = this.nodes = []
129-
var scope = this.scope
130+
var vm = this.vm
130131
var next
131132
while (node !== this.end) {
132133
nodes.push(node)
133134
next = node.nextSibling
134-
transition.remove(node, scope)
135+
transition.remove(node, vm)
135136
node = next
136137
}
137138
parent.removeChild(this.node)

0 commit comments

Comments
 (0)