Skip to content

Commit 1df5eb6

Browse files
committed
call unlink function in unbind for v-if and v-partial (fix vuejs#728)
1 parent 2e1e9e4 commit 1df5eb6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/directives/if.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ module.exports = {
107107
}
108108
this.unlink()
109109
this.unlink = null
110+
},
111+
112+
// NOTE: this function is shared in v-partial
113+
unbind: function () {
114+
if (this.unlink) this.unlink()
110115
}
111116

112117
}

src/directives/partial.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
// same logic reuse from v-if
1010
compile: vIf.compile,
1111
teardown: vIf.teardown,
12+
unbind: vIf.unbind,
1213

1314
bind: function () {
1415
var el = this.el

0 commit comments

Comments
 (0)