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

provide a compiler macro "defineOptions" #5440

Closed
lovetingyuan opened this issue Feb 17, 2022 · 1 comment
Closed

provide a compiler macro "defineOptions" #5440

lovetingyuan opened this issue Feb 17, 2022 · 1 comment

Comments

@lovetingyuan
Copy link

What problem does this feature solve?

In script setup, if we want to declare some options like name or inheritAttrs, we need to add a new script block without setup, how about place options in defineOptions({ name: 'MyComponent' }), so we still use a single setup script, and no need to add extra script tag.

What does the proposed API look like?

Just like defineProps and defineEmits, offer an api named defineOptions

<script setup>
defineOptions({
  name: 'MyComponent',
  inheritAttrs: false
})
</script>
@caozhong1996
Copy link
Contributor

Duplicate of #5218, see RFC

@ygj6 ygj6 closed this as completed Feb 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2023
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

3 participants