Does composable api support tree shaking ? #8138
Unanswered
brightchip
asked this question in
Help/Questions
Replies: 1 comment
-
Composition Api supports watch, props and other things you can do. You should read the docs. For mixins, you can create your own hooks. |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was planing to migrate my nuxt 2 project to nuxt 3. But I had so much question I'd like to ask for help!!
Not mean tb rude but the composable api is like an immature thing, which does not support 'props', 'emit', 'watch', 'componnets' and I don't how to reuse my codes if I wasn't using mixins
As the official document says they no longer recommend using mixin !?
With mixins: I can reuse many things like this
With vue 3 composable apis, Everytime to use them I had to construct the refs(var) and deconstruct them.
I was too lazy to put variables one by one and I had to call the deconstructed objs inside another wraper function in case it isn't reactive:
If I put it inside another composable and I had to repeating the constructing-deconstructing things.
Is
const {var2, var3} = useMain()
gets tree shaking ??If not which I think so, How do I write my codes to get better performance and less codes. ( I planed to continue using mixins with composables but it isn't under official documents 's suggestion)
Beta Was this translation helpful? Give feedback.
All reactions