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

v-for with v-else does not work on <template> #1637

Closed
xPaw opened this issue Jul 19, 2020 · 1 comment
Closed

v-for with v-else does not work on <template> #1637

xPaw opened this issue Jul 19, 2020 · 1 comment
Labels
🐞 bug Something isn't working scope: compiler

Comments

@xPaw
Copy link

xPaw commented Jul 19, 2020

Version

3.0.0-rc.1

Reproduction link

https://jsfiddle.net/Ld492zqn/

Steps to reproduce

From what I gathered, in Vue 2 v-for is lower priority than v-else so it should work correctly, but updating to vue 3 makes this code no longer work.

I looked in the vue eslint plugin, and they didn't add a warning for this because it's expected to work: vuejs/eslint-plugin-vue#799 (comment)

What is expected?

The loop works correctly.

What is actually happening?

message (key) is undefined

@xPaw xPaw changed the title v-for with v-else does not work correctly v-for with v-else does not work on <template> Jul 19, 2020
@xPaw
Copy link
Author

xPaw commented Jul 19, 2020

Changing template to div fixes the issue.

AST for template

AST for div

It's not generating _renderList

@yyx990803 yyx990803 added 🐞 bug Something isn't working scope: compiler labels Jul 19, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

No branches or pull requests

2 participants