vuejs / vue-vapor

Vue Vapor is a variant of Vue that offers rendering without the Virtual DOM.
https://vapor-repl.netlify.app
MIT License
1.94k stars 94 forks source link

Slots level mess up #242

Open Doctor-wu opened 4 months ago

Doctor-wu commented 4 months ago

Currently, dynamic slots will re-render when dependencies change. It will override static slots if the dynamic slot has the same name as the static slots which is not expected. Slots should determine who renders based on the declaration order.

Check DEMO and change input's value, and then change back to "default", you will find the dynamic slots rendered, but it shouldn't, since static slot declared later than dynamic slot.

sxzz commented 4 months ago

Recording:

https://github.com/vuejs/core-vapor/assets/6481596/e010e428-ed67-49a0-ae3a-26bee760f05a

Expected behavior: https://play.vuejs.org/#eNp9k01v2zAMhv8KoR2SAJ192E5ZUmAbetgO67DuNu3g2nTqVJYMiU5TGP7vJeWP9Ptm8X1JvSIed+pr0ySHFtVabULuq4YgILUNmMzutlpR0Opc26punCf47uoGSu9qWCSpHKR18WXWO/BYQj9aRNNW29zZQEB4JNiKYbkosMxaQ4uVtpt0uJYv4QNh3ZiMkE8Am8o2LcHhY+0KNBKGR2gF6aDK/fGLv6c++PBPTP/HOkBxb7O6yqHrhgB9P3akj656MWTMN08JlBEPGcuvTJDjmOdJXZ3xBvn9ZbVL9sFZXnMnbq1ydlcG/WVDFe9HqzVERbTMGHf3M9bIt3g21fMbzG9fqe/DUWpa/fYY0B9Qq1mjzO+QtybyxdWvuMFZ5MW2ht3viH8wONNKxsH2rbUFx37ki2l/RAAqu/sbLo6ENkyPkqDi7KNfK4ZCFvXW009xPyWfY5+2PW9xgu05pyc2O2gDXhlH4QmADOdEYIjidvYtGb9BucV7EZYr2J7D5fUec0qktowt71PKZEXramRrU1QHZrZ0nollBVw5GuKfFNGRsbBmMnHwnKBOufsFRP0DNL83Ig==