Subscribe on changes!

Components without a script block (or an empty one) don't get `name` set, so Keep-Alive with `include`doesn't work for them.

avatar
Sep 20th 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNqlU01v2zAM/SuEThmSWOuOhlvMznG3oUcdmjqMrU6WBElOVxj+76XsJE6afqKADhI/nh75yI7l1ia7FlnKMl86aQN4DK0FtdbVtWDBC3YjNIBsrHEBctg604BgCc9jnmAnzmJyFhfO1eRcXTg7X6+VMo9/cdsf4o4xCgOUtTEeN3ANU+Qs/yF0xkfaRJIeARur1gEHytkfRJsruUOQulTtBqmgfFEsVvuaKKQ0RECjDpBKT+79P4IBHzH4EWR837chGA2/SyXLf1MCEcsJ9dZUlUIIBvKMj6EfpRVnacVn02INU9rqJC3jxy6wBRsbvGzWNnnwRpPOXUQWewfJm8Jgibah5Sld6hCsTzn32zJq9eAT4ypOt8S1OsgGE/TN8t6ZR4+OgAVbnGBwMu7QLR3qDTp072G+CL3AjbC90D2VMgxcHNRDfXBQUWrbBghPNioc8H8g/SiixNoogiXjbS090IkinbVoGJt3Jv84X0RgGOpXCdRXN12n26bvM073vfWlehQwnxPq/HW1PqIybYt7a03oB5oNcs9+nu4GcR927pvNG/fmS4xLo71RmChTze6uft2dseqfAcmChGg=

Steps to reproduce

1、when i write something to the input box of A component, it works image

2、toggle to B, click + image

3、toggle to C, write something to the input box image

Then click every button, you will find that input box of A component is empty. it should be cached, but not. And other component is cached normal. The C component like A component, but script tag that has statment in C component, B component is none.

When you delete include prop or add something to the A component