Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in interaction between v-slots and v-if #9658

Comments

@patrickas
Copy link

Version

2.6.8

Reproduction link

http://jsfiddle.net/6bk180pn/2/

Steps to reproduce

The fiddle contains three parts.
Part 1 is the old working syntax.
Part 2 is the commented out new syntax that does not work anymore, un-commenting this part triggers the error.
Part 3 is a workaround using the new syntax but that requires copying part of the code of the component to the parent so it works.

What is expected?

template is only included when the condition is true

What is actually happening?

syntax error


This seems like a regression especially since the old functionality will be discontinued in future releases.

@LinusBorg
Copy link
Member

I edited the example a bit to make the effect a bit more transparent.

http://jsfiddle.net/Linusborg/37bkj2qh/

Seems that indeed we have an issue when it comes to default slots in this specific scenario.

@patrickas
Copy link
Author

How can I re-open this case? I just tried the latest 2.6.9 that should contains a fix but I am still getting the same error.

After reading the code for the fix, it seems that it only helps in cases where the condition in the if statement is unrelated to the slot props.

But the cases such as the example given in the original bug report the same error is still happening.

@LinusBorg
Copy link
Member

Opern a new issue please.

@yyx990803
Copy link
Member

Note on the behavior difference between old and new syntax: #9725 (comment)

grolu added a commit to gardener/dashboard that referenced this issue May 25, 2020
…sion in Vue 2.6

The new v-slot directive, does not provide access to the slotProps to use in an v-if to overwrite the slot conditionally and have the default (fallback) slot content rendered otherwise.
See also these related issues:
vuejs/vue#10784
vuejs/vue#9725
vuejs/vue#9658
grolu added a commit to gardener/dashboard that referenced this issue May 26, 2020
* Ensure that member roles currently not supported by the dashboard don't get lost when updating a member
Fixed autofocus for some dialogs

* changes as discussed

* revert

* Fix secret access in slots

* Revert "Fix secret access in slots"

This reverts commit 90cc626.

* Fixed secret page, had to move code to parent component due to regression in Vue 2.6
The new v-slot directive, does not provide access to the slotProps to use in an v-if to overwrite the slot conditionally and have the default (fallback) slot content rendered otherwise.
See also these related issues:
vuejs/vue#10784
vuejs/vue#9725
vuejs/vue#9658
KSH-code pushed a commit to KSH-code/vue that referenced this issue Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment