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

literal constant references should be supported in macros #5750

Closed
sxzz opened this issue Apr 19, 2022 · 1 comment · Fixed by #5752
Closed

literal constant references should be supported in macros #5750

sxzz opened this issue Apr 19, 2022 · 1 comment · Fixed by #5752
Labels

Comments

@sxzz
Copy link
Member

sxzz commented Apr 19, 2022

What problem does this feature solve?

Consider the following code

<script setup>
const UPDATE_KEY = "foo"
defineEmits([UPDATE_KEY])
</script>

UPDATE_KEY will never be changed and uses no lifecycle hooks.
It can be hoisted, then defineProps and defineEmits can reference this variable.

What does the proposed API look like?

No API involved

yyx990803 pushed a commit that referenced this issue Mar 28, 2023
- Support using literal constants in macros
- fix useCssVars insert position edge case
- fix non-literal-const enum hoisting

close #5750
IAmSSH pushed a commit to IAmSSH/core that referenced this issue May 14, 2023
- Support using literal constants in macros
- fix useCssVars insert position edge case
- fix non-literal-const enum hoisting

close vuejs#5750
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants