We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db12331 commit 43ccd4cCopy full SHA for 43ccd4c
test/unit/specs/compiler/compile_spec.js
@@ -270,5 +270,32 @@ if (_.inBrowser) {
270
expect(childSpy).toHaveBeenCalledWith(2)
271
})
272
273
+ it('should remove transcluded directives from parent when unlinking', function (done) {
274
+ var vm = new Vue({
275
+ el: el,
276
+ template:
277
+ '<div v-if="ok">' +
278
+ '<div v-component="test">{{test}}</div>' +
279
+ '</div>',
280
+ data: {
281
+ test: 'parent',
282
+ ok: true
283
+ },
284
+ components: {
285
+ test: {
286
+ template: '<content></content>'
287
+ }
288
289
+ })
290
+ expect(vm.$el.textContent).toBe('parent')
291
+ expect(vm._directives.length).toBe(3)
292
+ vm.ok = false
293
+ _.nextTick(function () {
294
+ expect(vm.$el.textContent).toBe('')
295
+ expect(vm._directives.length).toBe(1)
296
+ done()
297
298
299
+
300
301
}
0 commit comments