Skip to content

Handle complex expressions in for loops and member expressions #46

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

Merged

Conversation

codders
Copy link
Contributor

@codders codders commented Jul 14, 2025

In order to render structured data in Vue templates, we need to be able to destructure more complex Javascript expressions both in the target of 'v-for' statments and in Javascript Member Expressions that use 'Computed' values.

Here we add support for data structures that use hypens in key names <div v-for="item in list['data-values']">, or numeric key names <div v-for="item in list[1]">, or in the case where the lookup key is itself an identifier `{{ data[variable] }}``.

Bug: T396098

In order to render structured data in Vue templates, we need to be
able to destructure more complex Javascript expressions both in the
target of 'v-for' statments and in Javascript Member Expressions
that use 'Computed' values.

Here we add support for data structures that use hypens in key names
`<div v-for="item in list['data-values']">`, or numeric key names
`<div v-for="item in list[1]">`, or in the case where the lookup
key is itself an identifier `{{ data[variable] }}``.

Bug: T396098
@codders codders force-pushed the feat/complex-expressions-in-for-loops-20250714 branch from 3cc9725 to f08ad1b Compare July 14, 2025 07:50
@codders codders requested a review from lucaswerkmeister July 14, 2025 08:10
Copy link
Member

@lucaswerkmeister lucaswerkmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid, thanks!

@lucaswerkmeister lucaswerkmeister merged commit 4d3000d into master Jul 14, 2025
8 checks passed
@lucaswerkmeister lucaswerkmeister deleted the feat/complex-expressions-in-for-loops-20250714 branch July 14, 2025 09:03
@codders codders restored the feat/complex-expressions-in-for-loops-20250714 branch July 17, 2025 10:49
@codders codders deleted the feat/complex-expressions-in-for-loops-20250714 branch July 17, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants