Replies: 3 comments 8 replies
-
Very interesting. Thanks for digging into this @innocenzi. We'll definitely want to solve this in a nice way, because |
Beta Was this translation helpful? Give feedback.
-
This is probably fixed with https://github.com/vuejs/rfcs/blob/master/active-rfcs/0040-script-setup.md#exposing-components-public-interface now 👍 Looks like this works: But this doesn't: EDIT - The compiler warning is just my outdated |
Beta Was this translation helpful? Give feedback.
-
Any update on having a Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using the
setup
sugar (RFC), we can't use persistent layouts, because there is no way to set a property (layout
in our case) on the instance.The only workaround I have right now is to abuse
defineProps
, which is used by the compiler:With this, I have to update
resolveComponent
and I can use persistent layouts:That's obviously an ugly workaround, and I'd like to be able to have a normal
resolveComponent
and having this kind of page component:I can't see how to do that yet though. We can't even implement the ugly workaround by having a very specific property name, because
defineProps
is only available inside the<script setup>
block, it can't be abstracted away, since the compiler specifically looks for it (ie. you don't actually need toimport { defineProps } from 'vue'
).Beta Was this translation helpful? Give feedback.
All reactions