Syntatic sugar ( macro ) for inheritAttrs and name. #431
fenilli
started this conversation in
RFC Discussions
Replies: 2 comments 2 replies
-
IMHO, this proposal seems to be too restricted. |
Beta Was this translation helpful? Give feedback.
2 replies
-
The proposal could be changed to be <script lang="ts">
export default {
inheritAttrs: true,
}
</script>
<script setup lang="ts">
useMisc({
inheritAttrs: false,
});
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
This proposal is close related to #430, but aims to be constricted to these attributes.
Introduces macros in script setup, specifically to be able to set inheritAttrs and name.
Motivation
Writing components that should pass down props and attrs to the correct tags in the new script setup is verbose, and tedious. So this proposal tries to fix this issue by adding macros to merge or overwrite those attributes.
Example
Equivalent Output
Example with user defined script tag
Equivalent Output
Behaviour
Beta Was this translation helpful? Give feedback.
All reactions