Skip to content

literal constant references should be supported in macros #5750

Closed
@sxzz

Description

@sxzz

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions