Subscribe on changes!

When there is no parent element in the component template, Invalid using the v-show directive

avatar
Sep 26th 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNpVj8EOgjAMhl9l2cWLbNEjmSTG19gFdSjGbc064EB4d1sQoqfta//2/zvKM4DqOydLafCWWsgCXe6gsqH1EFMWl+hBNCl6sVOageU7G4xe9KQkyM7Du86OSAgzz/QFPuNwauo3usrMo9Q1epPKvVw8Cl+DemEMlGLkBfbbQCtLMVe4Rr7MVj5zBiy1xubGYV6oYnpo+qnUhdx6pxz64prigC7RYit5xWTDRJbrCXzxf+p721cHo/nZ+Ljyb+7pA5a0am0=

Steps to reproduce

使用 v-show 指令来控制子组件显示与隐藏时, 如果子组件中有多个根元素, 那么 v-show 指令无法生效

What is expected?

期待 v-show 能正常隐藏子组件所有元素

What is actually happening?

v-show 不起作用, 子组件所有元素在 v-show = false 时仍然显示出来

System Info

No response

Any additional comments?

No response

avatar
Sep 26th 2022

This is expected behavior.