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

Using defineProps in a multiple-variable declaration causes compiler to produce invalid code. #3739

Closed
wenkm opened this issue May 7, 2021 · 0 comments
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: script-setup scope: sfc

Comments

@wenkm
Copy link

wenkm commented May 7, 2021

Version

3.0.11

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8aDE+e3sgbXNnIH19PC9oMT5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQgc2V0dXA+XG4gIGltcG9ydCB7ZGVmaW5lUHJvcHMsIHJlZn0gZnJvbSAndnVlJztcblx0Y29uc3QgcHJvcHMgPSBkZWZpbmVQcm9wcyhbJ2l0ZW0nXSksXG4gICAgICAgIGN1cnJlbnRDb21wID0gcmVmKG51bGwpO1xuPC9zY3JpcHQ+IiwiQ29tcC52dWUiOiIifQ==

Steps to reproduce

declare props with other variables

What is expected?

No error.

What is actually happening?

When I declare props, if I declare it with other variables, it will be compiled with an extra comma, resulting in an error on the page. But not if I declare it separately. I made a video.
当声明props的时候,如果跟其他变量一起声明,在编译后会多一个逗号导致报错,但是分开声明就不会。

default.mp4
@HcySunYang HcySunYang added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels May 7, 2021
@LinusBorg LinusBorg changed the title Problems related to compilation Using defineProps in a multiple-variable declaration causes compiler to produce invalid code. May 7, 2021
Sociosarbis added a commit to Sociosarbis/vue-next that referenced this issue May 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working scope: script-setup scope: sfc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants