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

fix(compiler-core): Properly handle v-for and ref on templates #8403

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

baiwusanyu-c
Copy link
Member

close: #8395

@baiwusanyu-c
Copy link
Member Author

The implementation of this unit test is very inelegant, I think I need some guidance

@Alfred-Skyblue
Copy link
Member

expect(slots).toHaveProperty('arguments[1].elements[0].arguments[1].returns.properties[1].value.returns[0].codegenNode.props.properties[0]',spy)

@github-actions
Copy link

github-actions bot commented Sep 28, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 89.5 kB 34 kB 30.7 kB
vue.global.prod.js 147 kB (+167 B) 53.4 kB (+50 B) 47.6 kB (-15 B)

Usages

Name Size Gzip Brotli
createApp 49.8 kB 19.5 kB 17.8 kB
createSSRApp 53.1 kB 20.8 kB 19 kB
defineCustomElement 52.1 kB 20.3 kB 18.5 kB
overall 63.3 kB 24.4 kB 22.3 kB

@skirtles-code
Copy link
Contributor

I just tried to test this fix in the Playground preview, but I'm getting an error in the console:

I'm not exactly sure why, but it seems that child.codegenNode is undefined in some scenarios, leading to the error. I see the same error if I test this PR with the original reproduction on the issue.

Also, from what I can tell, this fix is only considering top-level ref attributes within a slot. e.g.:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

ref inside v-for on template does not populate as an aray
4 participants