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

Conditionally changing the order of slots works incorrectly in --env=production mode of Vue. #6997

Closed
timbenniks opened this issue Nov 3, 2017 · 1 comment
Labels

Comments

@timbenniks
Copy link
Contributor

timbenniks commented Nov 3, 2017

Version

2.5.2

Reproduction link

https://codepen.io/timbenniks/pen/oMzbzZ

Steps to reproduce

After opening the codepen please click on the "toggle" button.

What is expected?

The slots which show the numbers should inverse when clicking on the toggle button. Their order is changed with a v-if condition.

What is actually happening?

The slots do not switch order. The first slot seems to switch, the second slot seems to stay in place.

Instead of:
1,2 to 2,1

This happens:
1,2 to 2,2

We have tried this with more slots and the results are unpredictable.


We are changing the order of slots for features that change location on small or big screens. Sometimes the structure of a page changes too much so we change the order of slots to manage this. We only noticed the bug when we set the env to production. All works fine in development mode.

@posva posva added the bug label Nov 3, 2017
@posva
Copy link
Member

posva commented Nov 3, 2017

As a workaround for the moment, you can add a key attribute to one or the two div (slots) containers

lovelope pushed a commit to lovelope/vue that referenced this issue Feb 1, 2018
f2009 pushed a commit to f2009/vue that referenced this issue Jan 25, 2019
aJean pushed a commit to aJean/vue that referenced this issue Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants