Mechazawa / vue2-teleport

Teleport component for vue2 that works the same as vue3's teleport
Creative Commons Zero v1.0 Universal
33 stars 4 forks source link

feat: watch teleport slot change #2

Closed jackiotyu closed 6 months ago

jackiotyu commented 2 years ago

it may improve this case: the slot element is change by v-if

Mechazawa commented 2 years ago

Looks good, I'll test this during my weekend 👍

jackiotyu commented 2 years ago

thanks

eriksaulnier commented 6 months ago

@Mechazawa any chance of getting this feature merged and released?

Mechazawa commented 6 months ago

Sorry, completely forgot. Looks good

Mechazawa commented 6 months ago

It's included in v1.1.1

eriksaulnier commented 6 months ago

@Mechazawa it looks like this PR ended up breaking the teleport component a bit :( maybe best to revert? unless you or @jackiotyu can figure out what is going on.

jackiotyu commented 6 months ago

@eriksaulnier @Mechazawa image image version 1.1.0 missing dist folder.

jackiotyu commented 6 months ago

https://github.com/Mechazawa/vue2-teleport/blob/6bb4ea5f4e26e294e9e5948a8604830105213f0d/src/Teleport.vue#L148 My mistake, this line of code caused the nodes to not synchronize destruction after the teleport component was destroyed. The reason is that after internal node updates, the reference to childNodes changes upon reacquisition. It still works fine after removing it.

Anyone has problem, please try the fixed in #7 😔