Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
-
Click "remove el1" and then click "prepend el1", we'll get an error
-
Refresh the page, click "move el2 to el1". el2 is not updated
-
Refresh the page, click "remove el2" and "append el2", and then click "change el2 attr", its attribute is changed, but prop is not updated
What is expected?
Remove custom element and append it back should work as expected
What is actually happening?
For now, Vue will unmount the custom element after next tick of disconnection. If we append fully unmounted element back to document, there can be multiple issues
First, if the custom element has other custom element inside it, we'll get an error when _setParent()
Also, as mutationObserver is disconnected and we don't re-create it when connect, changing element's attributes will not work.
Besides, expose could not work as it refers to old data
I think we should re-mount the element at that case, also we need to delete exposed data if element is fully unmounted
System Info
No response
Any additional comments?
No response