Skip to content

I found a bug here #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pucelle opened this issue Apr 17, 2015 · 3 comments
Closed

I found a bug here #791

pucelle opened this issue Apr 17, 2015 · 3 comments

Comments

@pucelle
Copy link

pucelle commented Apr 17, 2015

Hi, 尤小右, I created a big project using you vue.js, Thanks to your work.

and I may found a bug here:
When compiling a component, it has a _containerUnlinkFn used to unbind all the derectives, and when it create a inherited child, the child inherits it's _containerUnlinkFn method, but when destroy this child, it called this container unlink fn, and unbind the directives which belongs to the component.

I tried to add a line of code here:
el = transclude(el, options)
this._initElement(el)
this._containerUnlinkFn = undefined //I inserted this line, and it works now.

Thanks.

@yyx990803
Copy link
Member

Wow, good catch!

yyx990803 added a commit that referenced this issue Apr 17, 2015
... so that we don't accidentally fallback to parent's unlink fns
when an instance with `inherti:true` is destroyed. Fixes #791.
@pucelle
Copy link
Author

pucelle commented Apr 17, 2015

Hi, I just found I should add the line of code to here to make it works... Certainly this is a temporary solution... I think you can solve it in a better way.

this._initElement(el)
options._linkFn(this, el)
this._containerUnlinkFn = undefined //[HERE]

@yyx990803
Copy link
Member

I already made a fix here: yyx990803/vue@99f011b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants