Skip to content

Commit 851be88

Browse files
committed
fix fragment transition context (fix #1295)
1 parent bc4ef8d commit 851be88

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
@@ -77,7 +78,7 @@ function singleBefore (target, trans) {
7778
var method = trans !== false
7879
? transition.before
7980
: _.before
80-
method(this.node, target, this.scope)
81+
method(this.node, target, this.vm)
8182
this.inserted = true
8283
if (_.inDoc(this.node)) {
8384
this.callHook(attach)
@@ -90,7 +91,7 @@ function singleBefore (target, trans) {
9091

9192
function singleRemove () {
9293
var shouldCallRemove = _.inDoc(this.node)
93-
transition.remove(this.node, this.scope)
94+
transition.remove(this.node, this.vm)
9495
this.inserted = false
9596
if (shouldCallRemove) {
9697
this.callHook(detach)
@@ -107,12 +108,12 @@ function singleRemove () {
107108
function multiBefore (target, trans) {
108109
_.before(this.node, target)
109110
var nodes = this.nodes
110-
var scope = this.scope
111+
var vm = this.vm
111112
var method = trans !== false
112113
? transition.before
113114
: _.before
114115
for (var i = 0, l = nodes.length; i < l; i++) {
115-
method(nodes[i], target, scope)
116+
method(nodes[i], target, vm)
116117
}
117118
_.before(this.end, target)
118119
this.inserted = true
@@ -130,12 +131,12 @@ function multiRemove () {
130131
var parent = this.node.parentNode
131132
var node = this.node.nextSibling
132133
var nodes = this.nodes = []
133-
var scope = this.scope
134+
var vm = this.vm
134135
var next
135136
while (node !== this.end) {
136137
nodes.push(node)
137138
next = node.nextSibling
138-
transition.remove(node, scope)
139+
transition.remove(node, vm)
139140
node = next
140141
}
141142
parent.removeChild(this.node)

0 commit comments

Comments
 (0)