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: generate __VLS_props just in place #3644

Merged
merged 4 commits into from Oct 11, 2023

Conversation

so1ve
Copy link
Member

@so1ve so1ve commented Oct 9, 2023

close #3643

@johnsoncodehk
Copy link
Member

For the following source code.

const name = 'foo';
const foo = defineProps([name]).foo;

I think a better way is generate it to:

const name = 'foo';
const __VLS_props = defineProps([name])
const foo = __VLS_props.foo;

We need to return the const foo = defineProps([name]).foo; range from parseScriptSetupRanges() and then it should be easy to do.

@so1ve
Copy link
Member Author

so1ve commented Oct 10, 2023

I think so, but IMO this will require much more work.

@johnsoncodehk
Copy link
Member

Updated, it might be simpler than you expect. ;)

@johnsoncodehk johnsoncodehk changed the title fix: don't replace props definition with __VLS_props fix: generate __VLS_props just in place Oct 11, 2023
@johnsoncodehk johnsoncodehk merged commit b88956f into vuejs:master Oct 11, 2023
3 checks passed
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.

defineProps([vars]) is broken
2 participants