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

defineModal default can't use const value #10093

Closed
mo-xuan opened this issue Jan 12, 2024 · 1 comment
Closed

defineModal default can't use const value #10093

mo-xuan opened this issue Jan 12, 2024 · 1 comment

Comments

@yyx990803
Copy link
Member

yyx990803 commented Jan 12, 2024

This is expected because the options for defineModel is used as the props options and will be moved outside of setup scope. Similar to the options in defineProps and defineOptions.

Note if the constant is a primitive value that can be safely hoisted out, this will work; however, your constant value is an object that may be mutated, so it cannot be hoisted out and therefore cannot be referenced.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants