Skip to content

Fix template interpolation in vfor when readonly array #1788

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
merged 1 commit into from
Mar 17, 2020

Conversation

yoyo930021
Copy link
Member

@yoyo930021 yoyo930021 commented Mar 16, 2020

When array is readonly, I will get any in v-for element.

@yoyo930021 yoyo930021 changed the title Fix template interpolation on vfor when readonly array Fix template interpolation in vfor when readonly array Mar 16, 2020
@@ -29,6 +29,7 @@ export declare const ${componentHelperName}: {
};
export declare const ${iterationHelperName}: {
<T>(list: T[], fn: (value: T, index: number) => any): any;
<T>(list: readonly T[], fn: (value: T, index: number) => any): any;
Copy link
Member

Choose a reason for hiding this comment

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

I believe just changing existing T[] overload is enough rather than adding a new one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I change T[] to readonly T[] | T[].

Copy link
Member

Choose a reason for hiding this comment

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

I mean just changing it to readonly T[] because it's super type of T[]

Copy link
Member Author

Choose a reason for hiding this comment

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

Wow! I'm done.

@yoyo930021 yoyo930021 force-pushed the fix-readonly-array-in-vfor branch from 0b9202f to 0f83ba9 Compare March 17, 2020 02:42
@yoyo930021 yoyo930021 requested a review from ktsn March 17, 2020 02:43
@yoyo930021 yoyo930021 force-pushed the fix-readonly-array-in-vfor branch from 0f83ba9 to fe0e845 Compare March 17, 2020 03:10
Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

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

Thank you! CI failure looks unrelated with this.

@ktsn ktsn merged commit 8b3ecb6 into vuejs:master Mar 17, 2020
ktsn added a commit that referenced this pull request Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants